# Filter is slower than that not in a skewed dataset

**URL:** <https://discuss.elastic.co/t/filter-is-slower-than-that-not-in-a-skewed-dataset/224361>\
**Category:** Elasticsearch\
**Created:** [March 20, 2020, 7:06am UTC](https://discuss.elastic.co/t/filter-is-slower-than-that-not-in-a-skewed-dataset/224361 "2020-03-20T07:06:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ji\_Qiujia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ji_qiujia/32/64783_2.png) [@Ji\_Qiujia](https://discuss.elastic.co/u/Ji_Qiujia)\
**Post date:** [March 20, 2020, 7:06am UTC](https://discuss.elastic.co/t/filter-is-slower-than-that-not-in-a-skewed-dataset/224361/1 "2020-03-20T07:06:36Z")

</div>

```auto
{
  "from": 0,
  "size": 10,
  "query": {
    "bool": {
      "filter": [
        {
          "terms": {
            "platform": [
              "DPA"
            ],
            "boost": 1
          }
        }
      ],
      "must": [
        {
          "match": {
            "title": {
              "query": "牛奶",
              "minimum_should_match": "1"
            }
          }
        }
      ]
      
    }
  }
}	  

```

I built a index which has more than 80m documents, in which 90% is on platform "DPA".  
My problem is: when I use a filter query, the time used is much more than that not.  
I doubt if this situation is expected, and if it is, how should I improve my search time when I need to filter the DPA docs?

---

<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 17, 2020, 7:22am UTC](https://discuss.elastic.co/t/filter-is-slower-than-that-not-in-a-skewed-dataset/224361/2 "2020-04-17T07:22:05Z")

</div>

Closed on April 17, 2020, 7:22am UTC

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