# Elastic Benefits of using a single index or multiple index according to a particular criteria(say gender)

**URL:** <https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592>\
**Category:** Elasticsearch\
**Created:** [July 4, 2018, 3:53pm UTC](https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592 "2018-07-04T15:53:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayush\_Nenawati](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ayush\_Nenawati](https://discuss.elastic.co/u/Ayush_Nenawati)\
**Post date:** [July 4, 2018, 3:53pm UTC](https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592/1 "2018-07-04T15:53:11Z")

</div>

What is the query performance difference in querying to an index with all user data and querying to a particular index with half of the data?  
For instance if i have two indexes male and female. How much query improvement will i get in comparison to querying over one index and then filtering out based on gender field?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 5, 2018, 1:45am UTC](https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592/2 "2018-07-05T01:45:23Z")

</div>

If the second part of the query is something like a full text search and/or a geo sort by distance then having a filter to reduce the dataset will accelerate the execution.

---

<div class="post-metadata">

**Author:** ![Ayush\_Nenawati](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ayush\_Nenawati](https://discuss.elastic.co/u/Ayush_Nenawati)\
**Post date:** [July 5, 2018, 7:24am UTC](https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592/4 "2018-07-05T07:24:52Z")

</div>

So shall i make two indexes male and female instead of a single index and querying on gender='male' ? If so how much time will it save for some million user data.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 5, 2018, 7:49am UTC](https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592/5 "2018-07-05T07:49:35Z")

</div>

I don't think you will really notice the difference.

But the only way to get an answer is to try it.  
Injecting few millions random data is quite easy.

For example: [https://github.com/dadoonet/legacy-search/tree/06-fuzziness?files=1](https://github.com/dadoonet/legacy-search/tree/06-fuzziness?files=1)

---

<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:** [August 2, 2018, 7:49am UTC](https://discuss.elastic.co/t/elastic-benefits-of-using-a-single-index-or-multiple-index-according-to-a-particular-criteria-say-gender/138592/6 "2018-08-02T07:49:37Z")

</div>

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