# Fielddata memory usage

**URL:** https://discuss.elastic.co/t/fielddata-memory-usage/229550
**Category:** Elasticsearch
**Created:** [April 23, 2020, 9:18pm UTC](https://discuss.elastic.co/t/fielddata-memory-usage/229550 "2020-04-23T21:18:24Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)
#### Post date: [April 24, 2020, 12:14am UTC](https://discuss.elastic.co/t/fielddata-memory-usage/229550/2 "2020-04-24T00:14:04Z")

</div>

Hello @YvorL,

The `GET _cat/fielddata` shows not only the `fielddata`, (which as you've said should be used only by `text` fields), but also `global ordinals`.

Our [documentation provides a quite good explanation](https://www.elastic.co/guide/en/elasticsearch/reference/master/eager-global-ordinals.html#_what_are_global_ordinals) on what they are and why they are generated.

A really great answer has been provided on a similar question: [Global ordinals performance and size on-heap](https://discuss.elastic.co/t/global-ordinals-performance-and-size-on-heap/158320/2)

If you're executing aggregations or sorting on `keyword` fields with high cardinality (e.g. a field which represents a unique id or, for example, the `_id` of the document), the global ordinals are generated and as they're expensive to generate, they're cached indefinitely ([by default](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-fielddata.html#modules-fielddata)).

Another collateral case where `global ordinals` are being used is when you're using Kibana KQL and you are using the auto-complete on the field `_id`. Kibana will trigger behind the scenes an aggregation on such field.

If the `global ordinals` have been loaded by mistake (a bad aggregation or a bad query), you can clean the cache using `POST /<index name>/_cache/clear?fielddata=true`. See [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html) about the clear cache API.

---

_[View the full topic](https://discuss.elastic.co/t/fielddata-memory-usage/229550)._
