elastic / kibana

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

[Research] Query consolidation on Dashboards #175702

Open thomasneirynck opened 8 months ago

thomasneirynck commented 8 months ago

On Dashboards context, many widgets issue individual queries to Elasticsearch.

In the majority of real world use-cases, some of these queries will share the same root aggregations. e.g. a Date histogram over identical time-ranges. It is more efficient (less network traffic, less ES load) to issue a single query that returns the same data as issuing multiple queries.

Goal

(1) Investigate "automagic" consolidation of queries.

There is a tight overlap here with https://github.com/elastic/kibana/issues/166206, as this would rely on a client-side consolidation layer.

(2) Rather than having Kibana do this consolidation ad-hoc, consider if more explicit data modeling by the user may achieve the same effect.

e.g. multiple charts reading different data from different columns in the same ES|QL statement.

This relies on the assumption that a single ES-query with two metrics (e.g. | stats foo, bar would be more efficient than two queries with two separate (e.g. | stats foo ... and | stats bar ...).

elasticmachine commented 8 months ago

Pinging @elastic/kibana-presentation (Team:Presentation)

thomasneirynck commented 2 months ago

Discussed with @teresaalvarezsoler . This is speculative, and not high priority for now.