elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.53k stars 24.61k forks source link

ES|QL: quantify memory footprint (live objects and serialization) of query plan #111358

Open luigidellaquila opened 1 month ago

luigidellaquila commented 1 month ago

ES|QL query plans can be pretty large, in some cases they can contain thousands of objects. Eg. the plan of a query like from * will likely contain many FieldAttributes/EsFields. The plan fragment will eventually serialized, and most likely the serialized plan will have an even larger footprint.

Some information is redundant in the plan, eg. an ExchangeSinkExec.output will likely contain the same FieldAttributes of the Project contained in the fragment; when serializing the plan, even if the two lists contain the same objects, they will likely be serialized twice.

This issue is to track the effort to quantify how much memory we are actually consuming for plan building/optimization/coordination

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-analytical-engine (Team:Analytics)