# Is searches faster with more match queries?

**URL:** <https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867>\
**Category:** Elasticsearch\
**Tags:** kql-kibana-query-language\
**Created:** [October 28, 2021, 3:17am UTC](https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867 "2021-10-28T03:17:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MinwooKim](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@MinwooKim](https://discuss.elastic.co/u/MinwooKim)\
**Post date:** [October 28, 2021, 3:17am UTC](https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867/1 "2021-10-28T03:17:32Z")

</div>

I have two queries. And in the index all of the data have collectHour as 10.  
if I request both queries, the one with more match statements was faster....

I am curious, if all fields are inspected as columns that are in indexes in mysql DBs.

if I ever need fast searches, is it recommended to add more match fields that share the same values in all documents?

```auto
GET indexname/_count
{
    "query": {
        "bool": {
            "must": [
              {
                "match": {
                  "collectDate": "2021-10-27"
                }
              }
             ]
        }
    }
}

GET indexname/_count
{
    "query": {
        "bool": {
            "must": [
              {
                "match": {
                  "collectHour": "10"
                }
              },
              {
                "match": {
                  "collectDate": "2021-10-27"
                }
              }
             ]
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 28, 2021, 3:38am UTC](https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867/2 "2021-10-28T03:38:15Z")

</div>

Yes. All fields are, by default, indexed.

Adding more filters, or matches, will improve performance.

---

<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 28, 2021, 5:26am UTC](https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867/3 "2021-10-28T05:26:38Z")

</div>

Adding more clauses can speed up queries as there are likely to be fewer matches that need to be scored and sorted. At some point the number of clauses, especially if you have large sets of OR clauses, might reduce performance.

---

<div class="post-metadata">

**Author:** ![MinwooKim](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@MinwooKim](https://discuss.elastic.co/u/MinwooKim)\
**Post date:** [November 9, 2021, 1:06pm UTC](https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867/4 "2021-11-09T13:06:37Z")

</div>

Well, like I was aware....  
it sure makes sense with experts that confirm this basic fact...

---

<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:** [December 7, 2021, 1:06pm UTC](https://discuss.elastic.co/t/is-searches-faster-with-more-match-queries/287867/5 "2021-12-07T13:06:40Z")

</div>

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