feat(vortex-geo): prune ST_Intersects filters via the AABB zone statistics#8775
Merged
Conversation
…stic - Add GeoIntersectsPrune: skips chunks whose AABB is strictly separated from the filter constant's bounding box (touching boxes scan, since touching geometries intersect); NOT-intersects and unprovable shapes fall through to the scan - Restructure prune.rs into a directory module ready for future spatial predicates: mod.rs holds the shared proof vocabulary (geometry_and_constant, query_aabb, aabb_stat, min_dist_sq/max_dist_sq), each predicate is a leaf module owning its own test cases (distance.rs, intersects.rs), and shared zone-map fixtures live in test_harness.rs - Fold in the #8646 review follow-ups that missed its merge: the aabb_stat ctor (part of the restructure) and tests pinning the radius-literal tolerance set - an integer radius casts and prunes, null and extension-typed radii decline to a scan; the harness takes any literal scalar Signed-off-by: Nemo Yu <zyu379@wisc.edu>
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.
Rationale for this change
Follow-up to #8646, which added the
GeometryAabbzone-map statistic and used it to pruneST_Distance(geom, const) <op> rfilters. This PR adds the second spatial predicate on the same statistic:ST_Intersects(geom, const). A chunk whose AABB is strictly separated from the constant's bounding box cannot contain an intersecting row, so the zone is skipped without any IO.This PR also folds in two review follow-ups from #8646 that were pushed minutes after it merged:
tests pinning the radius-literal tolerance set, and the
aabb_statconstructor requested inreview.
What changes are included in this PR?
GeoIntersectsPrune(prune/intersects.rs): The proof ismin_dist_sq(chunk_aabb, query_aabb) > 0, strictly: boxes that merely touch must scan, since touching geometries intersect under OGC semantics.prune/restructure.Bboxzone-map statistic + distance-filter pruning #8646 review follow-ups: the radius conversion's contract is documented and pinned by tests.