# Performance considerations when accessing \_index field

**URL:** <https://discuss.elastic.co/t/performance-considerations-when-accessing-index-field/205591>\
**Category:** Elasticsearch\
**Created:** [October 29, 2019, 5:57am UTC](https://discuss.elastic.co/t/performance-considerations-when-accessing-index-field/205591 "2019-10-29T05:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vangap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vangap/32/44927_2.png) [@vangap](https://discuss.elastic.co/u/vangap)\
**Post date:** [October 29, 2019, 5:57am UTC](https://discuss.elastic.co/t/performance-considerations-when-accessing-index-field/205591/1 "2019-10-29T05:57:05Z")

</div>

Hi,

My question is similar to [Performance of the \_index field](https://discuss.elastic.co/t/performance-of-the-index-field/142599)

I want to understand how the query rewrite works internally and if there are any caveats w.r.t performance when using \_index to conditionally apply filters while querying on an alias.

If someone could point me to any github issue or some documentation where this might have been discussed, that would be helpful.

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 29, 2019, 6:41am UTC](https://discuss.elastic.co/t/performance-considerations-when-accessing-index-field/205591/2 "2019-10-29T06:41:32Z")

</div>

If you only want to query some of the indices, why query through the alias in the first place?

---

<div class="post-metadata">

**Author:** ![vangap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vangap/32/44927_2.png) [@vangap](https://discuss.elastic.co/u/vangap)\
**Post date:** [October 29, 2019, 8:14am UTC](https://discuss.elastic.co/t/performance-considerations-when-accessing-index-field/205591/3 "2019-10-29T08:14:31Z")

</div>

Sorry, If the intention of the question is not clear.

There are cases where one needs to use `_index` as a filter similar to the ones in the attached link above (basically mix filter clauses where a set of filters need to be applied only for `Index 1` and another set of filters for only `Index 2`).

---

<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:** [November 26, 2019, 8:21am UTC](https://discuss.elastic.co/t/performance-considerations-when-accessing-index-field/205591/4 "2019-11-26T08:21:20Z")

</div>

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