# How to search text in a table containing 100M rows?

**URL:** <https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120>\
**Category:** Elasticsearch\
**Created:** [May 21, 2015, 4:57pm UTC](https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120 "2015-05-21T16:57:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryodo](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ryodo](https://discuss.elastic.co/u/ryodo)\
**Post date:** [May 21, 2015, 4:57pm UTC](https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120/1 "2015-05-21T16:57:44Z")

</div>

I have a database that contains over 100 million rows in one table.

At the beginning we have used MySQL but it's been difficult to do a search (PHP, CakePHP) from within - it takes an hour to search words in a field that contains text.

After we migrated to MongoDB but we did not have the same search problem - takes 40 minutes to find a word in a field that contains text.

We are currently thinking about moving to ElasticSearch for better search time. Is that this is a good approach or is there a better tool for search in less than 3 min knowing my dedicated server contains just a Intel Xeon W3520 c 4/8 t + 2.66 GHz RAM 32 GB ECC under Debian and ispconfig3.

I want to know is that his is the right solution to go with my server and managed well the 100 million data.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [May 21, 2015, 5:26pm UTC](https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120/2 "2015-05-21T17:26:33Z")

</div>

Its very different then WHERE LIKE in MySQL but you can absolutely search  
100 million rows in tens of milliseconds so long as you don't try to return  
a huge number of them. You should spend a while reading the getting started  
guide  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/getting-started.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/getting-started.html)  
so you understand what is going on before you make a decision though.

---

<div class="post-metadata">

**Author:** ![ryodo](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ryodo](https://discuss.elastic.co/u/ryodo)\
**Post date:** [May 21, 2015, 6:07pm UTC](https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120/3 "2015-05-21T18:07:38Z")

</div>

thank you for your answer, in your opinion what is the best way to get my response in time is 3 min max confuguration with my server

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [May 21, 2015, 6:27pm UTC](https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120/4 "2015-05-21T18:27:10Z")

</div>

Read the docs like I said, stick to term queries where you can - work on  
making sure your analysis spits out the terms you want to search for.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:12am UTC](https://discuss.elastic.co/t/how-to-search-text-in-a-table-containing-100m-rows/1120/5 "2017-07-06T00:12:33Z")

</div>


