Skip to content

Conversation

@carlosdelest
Copy link
Member

Related: #134363

Avoids retrieving unnecessary fields in FieldExtractorExec on the node-reduce phase.

This PR checks that the fields retrieved are either:

  • Present on the TopN operator on the node-reduce phase, or
  • Needed on the top level Project for the node-reduce phase

This way, a query like:

FROM test METADATA _score
| WHERE knn(vector, [0, 1, 2])
| SORT _score DESC
| LIMIT 10
| KEEP id, _score

will not retrieve the vector field on the node-reduce phase and will avoid loading it completely from source.

@carlosdelest carlosdelest added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch :Search Relevance/ES|QL Search functionality in ES|QL labels Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL :Search Relevance/ES|QL Search functionality in ES|QL Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants