Skip to content

Conversation

@jordan-powers
Copy link
Contributor

When running a timestamp range query, as an optimization we check if the query range overlaps with the total range of values within a shard before executing the query on that shard. That way, if the range is disjoint, we can skip execution for
that shard. To get the range of values within a shard, we usually use the PointValues index on the shard. However, when the doc values skipper is enabled, the point values are not (as the reason for the skipper is to reduce storage overhead by removing the point values index). In this case, we need to instead get the range of values within the shard by using the skipper. This patch implements that logic.

Follow-up to #123191

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@jordan-powers jordan-powers changed the title Fix query rewrite to match:none optimization for indices with doc values skipper Fix timestamp range query optimization for indices with doc values skipper Mar 3, 2025
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jordan-powers jordan-powers merged commit 9e6fcf6 into elastic:main Mar 4, 2025
17 checks passed
@jordan-powers jordan-powers deleted the date-query-range-optimization-sparse-index branch March 4, 2025 16:19
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Mar 11, 2025
…ipper (elastic#123930)

When running a timestamp range query, as an optimization we check if the
query range overlaps with the total range of values within a shard before
executing the query on that shard. That way, if the range is disjoint, we
can skip execution for that shard. To get the range of values within a
shard, we usually use the PointValues index on the shard. However, when the
doc values skipper is enabled, the point values are not (as the reason for
the skipper is to reduce storage overhead by removing the point values
index). In this case, we need to instead get the range of values within the
shard by using the skipper. This patch implements that logic.

Follow-up to elastic#123191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants