Skip to content

Commit cdaa5a5

Browse files
feat(vortex-geo): prune ST_Intersects filters via the AABB zone statistics (#8775)
## Rationale for this change Follow-up to #8646, which added the `GeometryAabb` zone-map statistic and used it to prune `ST_Distance(geom, const) <op> r` filters. 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_stat` constructor requested in review. ## What changes are included in this PR? - **`GeoIntersectsPrune`** (`prune/intersects.rs`): The proof is `min_dist_sq(chunk_aabb, query_aabb) > 0`, strictly: boxes that merely touch must scan, since touching geometries intersect under OGC semantics. - **`prune/` restructure**. - **#8646 review follow-ups**: the radius conversion's contract is documented and pinned by tests. Signed-off-by: Nemo Yu <zyu379@wisc.edu>
1 parent 7f8d92f commit cdaa5a5

5 files changed

Lines changed: 478 additions & 234 deletions

File tree

vortex-geo/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use crate::extension::Polygon;
2020
use crate::extension::Rect;
2121
use crate::extension::WellKnownBinary;
2222
use crate::prune::GeoDistancePrune;
23+
use crate::prune::GeoIntersectsPrune;
2324
use crate::scalar_fn::contains::GeoContains;
2425
use crate::scalar_fn::distance::GeoDistance;
2526
use crate::scalar_fn::intersects::GeoIntersects;
@@ -70,6 +71,7 @@ pub fn initialize(session: &VortexSession) {
7071
// geometry columns.
7172
session.aggregate_fns().register(GeometryAabb);
7273

73-
// Register the spatial pruning rule that uses that AABB.
74+
// Register the spatial pruning rules that use that AABB.
7475
session.stats().register_rewrite(GeoDistancePrune);
76+
session.stats().register_rewrite(GeoIntersectsPrune);
7577
}

0 commit comments

Comments
 (0)