# Why is TermQuery so much faster than PointRangeQuery?

**URL:** <https://discuss.elastic.co/t/why-is-termquery-so-much-faster-than-pointrangequery/277740>\
**Category:** Elasticsearch\
**Created:** [July 4, 2021, 2:42pm UTC](https://discuss.elastic.co/t/why-is-termquery-so-much-faster-than-pointrangequery/277740 "2021-07-04T14:42:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [July 4, 2021, 2:42pm UTC](https://discuss.elastic.co/t/why-is-termquery-so-much-faster-than-pointrangequery/277740/1 "2021-07-04T14:42:25Z")

</div>

I have 1 index with data volume around 80 million. I had 1 slow query before, which was 3 conditions, including 1 date equivalent query as well as 2 numeric column equivalent queries, and the query time was at least 5 seconds or more.

But when I changed both the numeric column and the date column of the query condition to Keyword type, in going to the query, I found that it became exceptionally fast, within 10ms.

I looked at the query profile, the numeric column is executed as PonitRangeQuery, and the Keyword is executed as TermQuery.

I would like to understand why the difference between TermQuery and PonitRangeQuery is so big?

---

<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 1, 2021, 2:42pm UTC](https://discuss.elastic.co/t/why-is-termquery-so-much-faster-than-pointrangequery/277740/2 "2021-08-01T14:42:38Z")

</div>

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