# Slow query performance

**URL:** <https://discuss.elastic.co/t/slow-query-performance/16191>\
**Category:** Elasticsearch\
**Created:** [March 6, 2014, 11:50am UTC](https://discuss.elastic.co/t/slow-query-performance/16191 "2014-03-06T11:50:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke\_Wilson\_Mawer](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@Luke\_Wilson\_Mawer](https://discuss.elastic.co/u/Luke_Wilson_Mawer)\
**Post date:** [March 6, 2014, 11:50am UTC](https://discuss.elastic.co/t/slow-query-performance/16191/1 "2014-03-06T11:50:32Z")

</div>

Hi,

I'm trying to improve query performance. It takes an average of about 3  
seconds for simple queries which don't even touch a nested document, and  
it's sometimes longer.

curl  
"[http://searchbox:9200/global/user/\_search?n=0&sort=influence:asc&q=user.name:Bill%20Smith](http://searchbox:9200/global/user/_search?n=0&sort=influence:asc&q=user.name:Bill%20Smith)"

Even without the sort it takes seconds. Here are the details of the cluster:

1.4TB index size.  
210m documents that aren't nested (About 10kb each)  
500m documents in total. (nested documents are small: 2-5 fields).  
About 128 segments per node.  
3 nodes, m2.4xlarge (-Xmx set to 40g, machine memory is 60g)  
3 shards.  
Index is on amazon EBS volumes.  
Replication 0 (have tried replication 2 with only little improvement)

I don't see any noticeable spikes in CPU/memory etc. Any ideas how this  
could be improved?

Kind regards,

Luke

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/204f6112-18ca-46fb-83b9-730579c8fedd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/204f6112-18ca-46fb-83b9-730579c8fedd%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 6, 2014, 10:21pm UTC](https://discuss.elastic.co/t/slow-query-performance/16191/2 "2014-03-06T22:21:15Z")

</div>

If you are not concerned with relevance scores, you might want to use  
filters exclusively. This article describes what filters are and how to use  
them effectively:

> **[All About Elasticsearch Filter BitSets
	  	 | Elastic](https://www.elastic.co/blog/all-about-elasticsearch-filter-bitsets)**
>
> WARNING: This article contains outdated information. We no longer recommend taking its advice. When building queries in Elasticsearch, you’ll often find yourself composing sets of filters. Say you nee...

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a0353fd1-2a24-4a7e-8132-e98fcb5b3c22%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a0353fd1-2a24-4a7e-8132-e98fcb5b3c22%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:45am UTC](https://discuss.elastic.co/t/slow-query-performance/16191/3 "2017-07-06T01:45:14Z")

</div>


