Answer the MobilityDB operators soundly from a multi-entry key - #32
Merged
estebanzimanyi merged 1 commit intoAug 28, 2026
Merged
Conversation
A key of a multi-entry index covers one entry of the indexed value, while the consistent methods of MobilityDB answer for a key that covers the whole value. The operator classes for the temporal, the temporal number and the temporal point types read those methods, and two of their answers do not hold for an entry: contains and same ask the key to hold the query, which no single entry need do even when the value holds it, and the position strategies are exact for a key covering the whole value, so MobilityDB reports that they need no recheck. The multi-entry methods state both corrections, answering contains and same with overlaps and rechecking every strategy, and delegate the rest to MobilityDB, which keeps one implementation of the box semantics. The topological and the position operators of MobilityDB answer on the bounding box of a value. The entries of a value cover the value but not its bounding box, so a query that meets the box where no entry lies had no entry that could find it: tbl_tgeompoint rows 33 and 31 overlap as boxes while no entry of one meets the box of the other, and the index read 151 rows against 152 sequential. The bounding box is itself a key of the value, which gives every strategy that reads it an entry that answers it. The whole contrib suite, 28 tests, agrees with the sequential scan.
estebanzimanyi
force-pushed
the
mest-multientry-sound
branch
from
August 28, 2026 04:58
8a5cbbc to
b199dd4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A key of a multi-entry index covers one entry of the indexed value, while the consistent methods of MobilityDB answer for a key that covers the whole value. The operator classes for the temporal, the temporal number and the temporal point types read those methods, and two of their answers do not hold for an entry: contains and same ask the key to hold the query, which no single entry need do even when the value holds it, and the position strategies are exact for a key covering the whole value, so MobilityDB reports that they need no recheck. The multi-entry methods state both corrections, answering contains and same with overlaps and rechecking every strategy, and delegating the rest to MobilityDB, which keeps one implementation of the box semantics. The topological and the position operators of MobilityDB answer on the bounding box of a value; the entries of a value cover the value but not its bounding box, so a query that meets the box where no entry lies has no entry that can find it, and the bounding box is itself a key of the value. Measured on tbl_tint with num_boxes=3, contains reads 35 rows against 105 sequential; tbl_tgeompoint rows 33 and 31 overlap as boxes while no entry of one meets the box of the other, which reads 151 rows against 152. The whole contrib suite, 28 tests, agrees with the sequential scan against a MobilityDB that carries the split-box bound inclusivity fix.