elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.13k forks source link

[Lens] Inefficient default behavior on multiple top values #98452

Open flash1293 opened 3 years ago

flash1293 commented 3 years ago

Lens defaults to adding the "other" bucket to a top values dimension. If there are multiple top values dimensions, the requests for these "other" buckets are executed in series: https://github.com/elastic/kibana/blob/b2a9dd12a5db3c6ce5545290f5ff9748085dd7bd/src/plugins/data/common/search/search_source/search_source.ts#L414

With a slow data source this can cause the full request to take a very long time.

I took a look at the code and I'm pretty sure these requests need to run in series (because the "other" bucket of a parent terms agg can add new terms to the nested terms agg which would be considered in the nested "other" calculation).

Should we change the default for "other" buckets for deeply nested aggregations (only using "other" on the top level)?

elasticmachine commented 3 years ago

Pinging @elastic/kibana-app (Team:KibanaApp)

markov00 commented 3 months ago

The other bucket should also be enabled by default only in partition charts where we are use it to consider the whole dataset, and not just the top x. With every other chart type we can just disable it by default