elastic / elasticsearch

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

Pushdown of spatial sort-by-distance does not allow partial sorts #114515

Open craigtaverner opened 2 weeks ago

craigtaverner commented 2 weeks ago

The work done in https://github.com/elastic/elasticsearch/pull/112938 does most of the work to enable partial sorts, but the last change was disabled to keep the PR from growing even larger. We would like to re-enable this, but also by first writing a benchmark that demonstrates that it actually helps.

Consider the following query:

FROM airports 
| EVAL scale = 10 - scalerank
| EVAL distance = ST_DISTANCE(location, TO_GEOPOINT("POINT(12.565 55.673)"))
| SORT distance ASC, scale DESC
| LIMIT 10

This could have the sort by distance pushed down, but leave the sort by scale for the compute engine. This should improve performance, but we would like a benchmark to validate that.

elasticsearchmachine commented 2 weeks ago

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