You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
explorer: multi-tree facet filtering does N membership scans (slow in WASM at scale) — combine into one scan / cube #293
Follow-up to #281/#282/#291 (facet trees). When SEVERAL hierarchical dims (material/context/object_type) are selected at once, the table filter (facetFilterSQL) and the live count engine each issue one membership pid-subquery per selected tree dim, AND-ed. Each subquery is a full sample_facet_membership scan, so N selected tree dims = N scans — fast natively (~0.1s, per Codex) but slow in DuckDB-WASM at scale, especially un-bbox-pruned (global view, or the cross-filter 'other-dim' subqueries which aren't bbox-scoped).
Single-dim filtering (the common case) is fast and shipped. This is the multi-dim edge.
Options:
Table filter: collapse the N membership subqueries into ONE scan — pid IN (SELECT pid FROM membership WHERE (facet_type='material' AND concept_uri IN(...)) OR (facet_type='context' AND ...) OR ... GROUP BY pid HAVING COUNT(DISTINCT facet_type) = <#selected dims>).
Live counts: the per-dim cross-filter 'other-dim' subqueries also scan full membership; same collapse, and/or a precomputed facet_tree_cross_filter cube (also the global-view count follow-up).
Measure WASM latency; set the same p95 budget.
Until then: single-dim tree filtering is the fast path; multi-tree works (correct results) but can be slow at scale.
Closing as resolved. The multi-tree facet filtering that did N membership scans (slow in WASM at scale) has been eliminated: #299 introduced a per-pid tree bitmask filter and #298 added the cross-filtered facet-count cube (facet_tree_cross_filter), collapsing the multi-tree scan into a single pass. Both merged.
Activity
#291: extend the facet hierarchy tree to Sampled Feature + Specimen T…
isamplesorg#293: collapse multi-tree membership filter into ONE scan
isamplesorg#290/isamplesorg#293: facet_tree_cross_filter cube — globa…
isamplesorg#290/isamplesorg#293: address Codex round-1 review of the …
#290/#293: cross-filtered facet counts (facet_tree_cross_filter cube)…
isamplesorg#293: address Codex review — shared build_id guards mixed-…
isamplesorg#293: harden build_id guard (Codex round 2)
#293: per-pid tree bitmask filter — eliminate the multi-tree WASM dat…
#300: filtered H3 clusters at world zoom (don't force point mode for …
rdhyee commentedon Jun 19, 2026
Closing as resolved. The multi-tree facet filtering that did N membership scans (slow in WASM at scale) has been eliminated: #299 introduced a per-pid tree bitmask filter and #298 added the cross-filtered facet-count cube (facet_tree_cross_filter), collapsing the multi-tree scan into a single pass. Both merged.