# Compare query speeds of two different indices

**URL:** <https://discuss.elastic.co/t/compare-query-speeds-of-two-different-indices/174937>\
**Category:** Elasticsearch\
**Created:** [April 2, 2019, 8:03am UTC](https://discuss.elastic.co/t/compare-query-speeds-of-two-different-indices/174937 "2019-04-02T08:03:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praneet\_Khandelwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praneet_khandelwal/32/40565_2.png) [@Praneet\_Khandelwal](https://discuss.elastic.co/u/Praneet_Khandelwal)\
**Post date:** [April 2, 2019, 8:03am UTC](https://discuss.elastic.co/t/compare-query-speeds-of-two-different-indices/174937/1 "2019-04-02T08:03:04Z")

</div>

I have two separate indices for same data. I would like to compare the querying speed for the two indices using a python script. I am using the 'took' variable in my response as a metric.  
The thing I want to avoid is the use of cache by the query. I have set the parameter 'request\_cache' as False but I guess that does not seem to be working. Is there something wrong I am doing?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 2, 2019, 10:38am UTC](https://discuss.elastic.co/t/compare-query-speeds-of-two-different-indices/174937/2 "2019-04-02T10:38:58Z")

</div>

It doesn't make any sense to measure the speed of something with the cache disabled. This doesn't tell you anything useful, because in real life the cache is enabled and is a critical factor affecting how the system performs.

[Rally](https://esrally.readthedocs.io/en/stable/) is a good way to benchmark your cluster and helps you avoid some common pitfalls. There is also a recorded presentation about [common mistakes when benchmarking](https://www.elastic.co/elasticon/conf/2018/sf/the-seven-deadly-sins-of-elasticsearch-benchmarking) that would be good to watch.

---

<div class="post-metadata">

**Author:** ![Praneet\_Khandelwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praneet_khandelwal/32/40565_2.png) [@Praneet\_Khandelwal](https://discuss.elastic.co/u/Praneet_Khandelwal)\
**Post date:** [April 2, 2019, 10:47am UTC](https://discuss.elastic.co/t/compare-query-speeds-of-two-different-indices/174937/3 "2019-04-02T10:47:54Z")

</div>

Thanks for the response.  
Actually I wanted to measure the improvement of the new index that I created with a well defined mapping. So all I wanted to do was see if that new mapping helps me .(The new mapping has a lot few fields that are indexed and the original mapping had all the fields as indexed.)

---

<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:** [April 30, 2019, 10:47am UTC](https://discuss.elastic.co/t/compare-query-speeds-of-two-different-indices/174937/4 "2019-04-30T10:47:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
