# Indexing flattened field with unique keys is very slow

**URL:** <https://discuss.elastic.co/t/indexing-flattened-field-with-unique-keys-is-very-slow/294833>\
**Category:** Logstash\
**Created:** [January 19, 2022, 2:38pm UTC](https://discuss.elastic.co/t/indexing-flattened-field-with-unique-keys-is-very-slow/294833 "2022-01-19T14:38:29Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 20, 2022, 10:03pm UTC](https://discuss.elastic.co/t/indexing-flattened-field-with-unique-keys-is-very-slow/294833/9 "2022-01-20T22:03:58Z")

</div>

> [@caseydm](#):
>
> The object has different keys ... for just about every record.

Well there's your problem. See [this](https://discuss.elastic.co/t/logstash-7-5-gc-too-frequently-to-work/290331/2) thread and the PRs linked to the PR it links to. logstash uses a hash to remember every key it has ever seen.

TL/DR: mitigated in the next releases (7.17 and 8.x).

---

_[View the full topic](https://discuss.elastic.co/t/indexing-flattened-field-with-unique-keys-is-very-slow/294833)._
