fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

Sorted and not primary key ordered

Open MMcM opened this issue 2 years ago • 0 comments

This predicate and the comment that follows are not correct:

                if (planOrderingKey != null && (sort != null || planOrderingKey.isPrimaryKeyOrdered())) {
                    // If there is a sort, all chosen plans should be ordered by it and so compatible.

The problem case is where there are additional ordering keys (that is, indexed fields) after the query's sort (which the plan satisfies), but before the primary key.

MMcM avatar May 25 '22 23:05 MMcM