-
Notifications
You must be signed in to change notification settings - Fork 102
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
Record Type comparison not included as able to satisfy a sort #744
Comments
This behavior is seen with the current planner (i.e., |
This adds test to demonstrate a deficiency in the planner pointed out in FoundationDB#744. The failing tests are disabled here so that they do not break the build but so that (a) there is a record in the code of the kind of cases that are broken here and (b) once the problem is fixed that PR can just enable these tests. This also makes the RecordTypeKeyTest extend from `RecordQueryTestBase` so that the `@DualPlannerTest` annotations can be applied, though it does not actually make any tests use the new planner (as they appear to not work yet with the way the planner is on master).
@alecgrieser is there any timeline or target release as to when this might be fixed ? |
There aren't really any updates for this, no. I don't believe anyone has yet started on it yet, with people currently all assigned to other issues. |
For future reference, this issue was also referenced in this forum post: https://forums.foundationdb.org/t/full-range-scan-performed-in-sort-when-not-required/1995 |
If one has a record type with a primary key like:
The the query:
Can be satisfied by scanning over records with a primary key beginning with that record type's record type key. This plan would look like:
In the
RecordQueryPlan
'stoString
representation. However, the actual plan is:That is, it does a full scan over everything and then filters out the other types. Practically speaking, the result you could back would be identical as if the sort were not specified (in this case), but (a) the planner isn't guaranteeing it and (b) there is no way to specify reverse-ness.
Adding this test to
RecordTypeKeyTest
demonstrates this:Note that if one includes the record type key in the sort predicate, then it will do a full scan. If one omits the record type key (which it should be able to), then it throws an error.
The text was updated successfully, but these errors were encountered: