# Sequence of clauses for performance

**URL:** https://discuss.elastic.co/t/sequence-of-clauses-for-performance/181199
**Category:** Elasticsearch
**Created:** [May 15, 2019, 12:52pm UTC](https://discuss.elastic.co/t/sequence-of-clauses-for-performance/181199 "2019-05-15T12:52:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)
#### Post date: [May 15, 2019, 12:52pm UTC](https://discuss.elastic.co/t/sequence-of-clauses-for-performance/181199/1 "2019-05-15T12:52:14Z")

</div>

I was curious to know whether the sequence of the clauses matter when we query elasticsearch.

If clause A matches 5k docs and clause B matches 2k docs. Which clause should be placed before the other one ? Or the sequence does not matter ?

Same question for clause sequence in filters too ?

---

<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: [June 12, 2019, 12:52pm UTC](https://discuss.elastic.co/t/sequence-of-clauses-for-performance/181199/2 "2019-06-12T12:52:19Z")

</div>

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