# Slow aggregation queries while ingesting data

**URL:** <https://discuss.elastic.co/t/slow-aggregation-queries-while-ingesting-data/108212>\
**Category:** Elasticsearch\
**Created:** [November 18, 2017, 12:05am UTC](https://discuss.elastic.co/t/slow-aggregation-queries-while-ingesting-data/108212 "2017-11-18T00:05:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![premieredigital](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/premieredigital/32/26987_2.png) [@premieredigital](https://discuss.elastic.co/u/premieredigital)\
**Post date:** [November 18, 2017, 12:05am UTC](https://discuss.elastic.co/t/slow-aggregation-queries-while-ingesting-data/108212/1 "2017-11-18T00:05:58Z")

</div>

I have a large aggregation query that becomes incredibly slow when I am updating my data. I am not saving the data to a tmp index (and then renaming it when it's done) but saving it directly to the index I'm querying.

- What are some ways to improve querying performance while indexing is occurring?
- What are the usual bottlenecks that I'm seeing here (possibly memory?)?

---

<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:** [November 18, 2017, 6:31am UTC](https://discuss.elastic.co/t/slow-aggregation-queries-while-ingesting-data/108212/2 "2017-11-18T06:31:27Z")

</div>

Try to identify what is limiting performance. Check CPU usage as well as disk I/O (including iowait).

What is the size of your cluster? What type of hardware? How much data and shards do you have?

---

<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 16, 2017, 6:31am UTC](https://discuss.elastic.co/t/slow-aggregation-queries-while-ingesting-data/108212/3 "2017-12-16T06:31:51Z")

</div>

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