At the moment ES SQL generates unique IDs for aggregation names in the form of a long numeric value, making sure the same value is not assigned to more than one element in the execution tree.
In the context of Elasticsearch caching, though, a query is cached by its json key which means that the same logical query will generate a different JSON because the aggregation names will be different. This makes caching the same SQL query results impossible from ES caching point of view.
At the moment ES SQL generates unique IDs for aggregation names in the form of a long numeric value, making sure the same value is not assigned to more than one element in the execution tree.
In the context of Elasticsearch caching, though, a query is cached by its json key which means that the same logical query will generate a different JSON because the aggregation names will be different. This makes caching the same SQL query results impossible from ES caching point of view.
Ideally, naming elements in a query dsl should be consistent from one execution of a query to the other execution of the same query. Relevant link - https://discuss.elastic.co/t/elasticsearch-7-0-sql-access-request-cache/186467.