{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/13985","repository_url":"https://api.github.com/repos/elastic/elasticsearch","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/13985/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/13985/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/13985/events","html_url":"https://github.com/elastic/elasticsearch/issues/13985","id":110173337,"number":13985,"title":"Revisit defaults for the `cardinality` aggregation?","user":{"login":"jpountz","id":299848,"avatar_url":"https://avatars.githubusercontent.com/u/299848?v=3","gravatar_id":"","url":"https://api.github.com/users/jpountz","html_url":"https://github.com/jpountz","followers_url":"https://api.github.com/users/jpountz/followers","following_url":"https://api.github.com/users/jpountz/following{/other_user}","gists_url":"https://api.github.com/users/jpountz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpountz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpountz/subscriptions","organizations_url":"https://api.github.com/users/jpountz/orgs","repos_url":"https://api.github.com/users/jpountz/repos","events_url":"https://api.github.com/users/jpountz/events{/privacy}","received_events_url":"https://api.github.com/users/jpountz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Aggregations","name":":Aggregations","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/discuss","name":"discuss","color":"fbca04"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/high%20hanging%20fruit","name":"high hanging fruit","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/stalled","name":"stalled","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-10-07T08:17:57Z","updated_at":"2016-10-24T15:01:29Z","closed_at":"2016-10-24T15:01:29Z","body":"The `precision_threshold` parameter of the cardinality aggregation not only has an impact on accuracy but also on memory usage. This is why by default we decide how much memory a cardinality aggregation may use depending on how deep it can be found in the aggregation tree. For instance a top-level cardinality aggregation would use 16KB of memory, a cardinality aggregation under a terms aggregation would use 512 bytes per bucket, and a cardinality aggregation under two (or more) levels of terms aggregation would use 16 bytes per bucket.\r\n\r\nUnfortunately, it's not easy to get precise counts with only 16 bytes of memory, which can make the out-of-the-box experience a bit disappointing. I think we have several (non-exclusive) options here:\r\n - increase default memory usage, but I'm nervous about making it even easier to trigger circuit-breaking errors or worse out-of-memory errors. Maybe #9825 could help here: we could decide to always run terms aggs in breadth-first mode if there is a cardinality agg under them so that the cardinality aggregation would be computed on fewer buckets\r\n - better document these defaults\r\n - move parts of the aggs computation to disk so that we can increase our defaults more safely"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/255766087","html_url":"https://github.com/elastic/elasticsearch/issues/13985#issuecomment-255766087","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/13985","id":255766087,"user":{"login":"jpountz","id":299848,"avatar_url":"https://avatars.githubusercontent.com/u/299848?v=3","gravatar_id":"","url":"https://api.github.com/users/jpountz","html_url":"https://github.com/jpountz","followers_url":"https://api.github.com/users/jpountz/followers","following_url":"https://api.github.com/users/jpountz/following{/other_user}","gists_url":"https://api.github.com/users/jpountz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpountz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpountz/subscriptions","organizations_url":"https://api.github.com/users/jpountz/orgs","repos_url":"https://api.github.com/users/jpountz/repos","events_url":"https://api.github.com/users/jpountz/events{/privacy}","received_events_url":"https://api.github.com/users/jpountz/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T15:01:29Z","updated_at":"2016-10-24T15:01:29Z","body":"Fixed via #19215"}}
{"actor":{"display_login":"jpountz"}}