Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlanOrderingKey contains value portion of key-with-value-expression in order #2469

Closed
alecgrieser opened this issue Jan 30, 2024 · 0 comments · Fixed by #2468
Closed

PlanOrderingKey contains value portion of key-with-value-expression in order #2469

alecgrieser opened this issue Jan 30, 2024 · 0 comments · Fixed by #2468
Assignees
Labels
bug Something isn't working planner Related to the query planner

Comments

@alecgrieser
Copy link
Contributor

The current PlanOrderingKey implementation will include the value components of a KeyWithValueExpression within the professed ordering for a plan. This can result in plans that have an incorrect idea as to the order of returned results, which can lead to faulty unions and intersections. From what I can tell, this is not as much of a problem for a single index scan, as that may not need to look at the PlanOrderingKey.

@alecgrieser alecgrieser added bug Something isn't working planner Related to the query planner labels Jan 30, 2024
@alecgrieser alecgrieser self-assigned this Jan 30, 2024
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Jan 30, 2024
…y-with-value-expression in order

This removes the value portion of a key-with-value expression from the `PlanOrderingKey` so that we do not attempt to order plans based on fields that do not actually contribute to the ordering of entries.
alecgrieser added a commit that referenced this issue Feb 27, 2024
…s multiple times (#2468)

* Fixes #2462: PlanOrderingKey tripped up if the same expression appears multiple times

This updates the handling for key expressions in `PlanOrderingKey` so that if the same expression appears multiple times, we only match it once.

This fixes #2462.

* Fixes #2469: PlanOrderingKey contains value portion of key-with-value-expression in order

This removes the value portion of a key-with-value expression from the `PlanOrderingKey` so that we do not attempt to order plans based on fields that do not actually contribute to the ordering of entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working planner Related to the query planner
Projects
None yet
1 participant