{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/12082","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12082/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12082/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12082/events","html_url":"https://github.com/elastic/elasticsearch/pull/12082","id":93505751,"number":12082,"title":"Add a terms aggregator based on ordinals that does not need global ordinals.","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/feature","name":"feature","color":"328a58"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/v2.0.0","name":"v2.0.0","color":"dddddd"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-07T11:10:19Z","updated_at":"2015-07-07T11:39:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/12082","html_url":"https://github.com/elastic/elasticsearch/pull/12082","diff_url":"https://github.com/elastic/elasticsearch/pull/12082.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/12082.patch"},"body":"Apart from the `map` execution mode which works on values and only really exists\r\nfor scripted terms aggregation, all our execution modes for string fields\r\nleverage global ordinals.\r\n\r\nThere are two main issues that users who run terms aggregations run into:\r\neither memory usage, and global ordinals help here by having a single count map\r\ninstead of one per segment, or rebuilding global ordinals upon refresh, for\r\nwhich there isn't really any option right now. So I would like to add a new\r\nexecution mode which leverages ordinals (on the contrary to `map`) but not\r\nglobal ordinals.\r\n\r\nFor now, this new execution mode is called `per_segment` and is never used by\r\ndefault. I intend to only have it as an escape hatch for some time so that users\r\nwho have issues with global ordinals building can experiment with it. Then we\r\ncan think about using it by default in some cases."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/119178611","html_url":"https://github.com/elastic/elasticsearch/pull/12082#issuecomment-119178611","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12082","id":119178611,"user":{"login":"bleskes","id":1006375,"avatar_url":"https://avatars.githubusercontent.com/u/1006375?v=3","gravatar_id":"","url":"https://api.github.com/users/bleskes","html_url":"https://github.com/bleskes","followers_url":"https://api.github.com/users/bleskes/followers","following_url":"https://api.github.com/users/bleskes/following{/other_user}","gists_url":"https://api.github.com/users/bleskes/gists{/gist_id}","starred_url":"https://api.github.com/users/bleskes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleskes/subscriptions","organizations_url":"https://api.github.com/users/bleskes/orgs","repos_url":"https://api.github.com/users/bleskes/repos","events_url":"https://api.github.com/users/bleskes/events{/privacy}","received_events_url":"https://api.github.com/users/bleskes/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T11:39:49Z","updated_at":"2015-07-07T11:39:49Z","body":"@jpountz and I discussed this and it seems the main use case for this mode is for using sparse queries where not too many ordinals will be hit and populated. I wonder (though not sure) whether it makes sense to use sparse ordinal arrays and if so, how would that compare with the existing map based execution mode."}}