# How to profile next\_doc take too long?

**URL:** <https://discuss.elastic.co/t/how-to-profile-next-doc-take-too-long/201120>\
**Category:** Elasticsearch\
**Created:** [September 26, 2019, 12:32am UTC](https://discuss.elastic.co/t/how-to-profile-next-doc-take-too-long/201120 "2019-09-26T00:32:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wesley\_Hsiung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wesley_hsiung/32/48570_2.png) [@Wesley\_Hsiung](https://discuss.elastic.co/u/Wesley_Hsiung)\
**Post date:** [September 26, 2019, 12:32am UTC](https://discuss.elastic.co/t/how-to-profile-next-doc-take-too-long/201120/1 "2019-09-26T00:32:04Z")

</div>

I have one index with 100 million docs, on 12 data nodes(with 12 shards), 16G ram, 500G storge each node; the query is filter on biz id(keyword) and date range and amt range; the biggest biz id have 20 million docs, and 95% biz id only have 1000 docs in average; so the problem is when query on the biggest id, the response time take 4+s,the small ids query only need 0.02s, after profile I find `breakdown` `next_doc` use the most time, how should I optimize this?

I can not split the biggest id to another index,cuz I split index on month, and I cannot predict future biggest id.

---

<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:** [October 24, 2019, 12:32am UTC](https://discuss.elastic.co/t/how-to-profile-next-doc-take-too-long/201120/2 "2019-10-24T00:32:06Z")

</div>

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