Skip to content

Conversation

@julian-elastic
Copy link
Contributor

@julian-elastic julian-elastic commented Nov 3, 2025

Improve Lookup Join performance by caching objects needed for Lucene Queries.

Credit goes to @dnhatn

@elasticsearchmachine elasticsearchmachine added v9.3.0 needs:triage Requires assignment of a team area label labels Nov 3, 2025
@julian-elastic julian-elastic self-assigned this Nov 3, 2025
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed needs:triage Requires assignment of a team area label labels Nov 3, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @julian-elastic, I've created a changelog YAML for you.

@julian-elastic
Copy link
Contributor Author

Buildkite benchmark this with esql-joins please


@Override
public void seekExact(BytesRef term, TermState state) throws IOException {
// TODO: when this can be true?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnhatn Do you need me to do any research on this one?

@julian-elastic
Copy link
Contributor Author

Buildkite benchmark this with esql-joins please

@dnhatn dnhatn self-requested a review November 20, 2025 00:19
if (terms == null) {
return null;
}
// Return a FilterTerms that always creates a fresh TermsEnum iterator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julian-elastic Sorry for the delay. I'm not sure this helps, since super.terms(k) likely gets it from a map as well. Is it possible to enable this cache only for a single term (depending on QueryList type), or to enable caching for DocValues only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I removed the termCache completely, and I still got the same improvement as without it.

@julian-elastic
Copy link
Contributor Author

Buildkite benchmark this with esql-joins please

@julian-elastic
Copy link
Contributor Author

Buildkite benchmark this with esql-joins please

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 24, 2025

💚 Build Succeeded

This build ran two esql-joins benchmarks to evaluate performance impact of this PR.

History

cc @julian-elastic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants