Repository navigation
feat(retrieval): HYPERMATCH structural matching (HGMatch, MaCH filter) - #116
Merged
Merged
Conversation
… patterns HYPERMATCH finds every injective, type-preserving map from a connected pattern of hyperedges to stored hyperedges with exactly the same members. It binds one whole hyperedge per search level: candidates are the hyperedges of the query hyperedge's signature (slot 48) intersected with the reverse-index postings of the matched atoms in each class of earlier query hyperedges, and a candidate is accepted when its matched members fall into those classes with the query's multiplicities, so no vertex assignment is ever searched. MODE MACH first cuts every candidate set to hyperedges supported by a candidate of each adjacent query hyperedge; AUTO picks it for unanchored patterns of three or more hyperedges. WHERE pins vertices to atoms, BINDINGS expands tuples into vertex assignments, and large first steps are searched on a fork/join pool under the statement's page budget. Candidates with a member the reader cannot see are rejected. No issue tracks this work.
BINDINGS expanded every vertex permutation of a tuple before LIMIT or the budget applied, so one symmetric hyperedge with a dozen members could exhaust the heap. Bindings are now generated one at a time and each counts against the row budget. The reader's type-grant cache was a HashMap that parallel search mutated from several threads; it is now a concurrent map replaced per generation. The MACH candidate filter charges the budget per probe, keeps its witnesses in arrays, is refused when the pattern has more than 2^20 candidates, and is not run by EXPLAIN or a second time for the trace. Parallel search uses one shared pool, a signature lookup returns nothing unless the key's name list holds that exact signature and tenant, and the statement reports the page budget of the read it runs in. No issue tracks this work.
# Conflicts: # database/src/main/java/io/hstore/db/Reader.java
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.
Stacked on #115: it reads the signature slots that #115 adds. Merge #115 first, then retarget this to
main.HYPERMATCHfinds every exact occurrence of a pattern of hyperedges: an injective, type-preserving map from the pattern's vertices to atoms, where each pattern hyperedge maps to a stored hyperedge with exactly the same members. It follows HGMatch (Yang et al., ICDE 2023) and binds one whole hyperedge per search level instead of one vertex.How it works
MODE MACH(from MaCH, arXiv 2512.10621): first cuts each candidate set to hyperedges supported by some candidate of every adjacent pattern hyperedge.AUTOpicks it for unanchored patterns of three or more hyperedges.WHERE u = @…pins vertices to atoms.BINDINGSlists vertex assignments, generated one at a time.COUNTcounts tuples.EXPLAIN HYPERMATCHshows the order.The syntax is open for renaming before merge:
Testing
SecurityTestcovers tenant scoping, anchors to another tenant's atoms, and cross-tenant memberships.Independent review. It found one critical and three important issues, all fixed with tests:
BINDINGSbuilt every permutation in memory beforeLIMITapplied (now lazy and budgeted).ConcurrentModificationExceptionin one of two runs of the new test.It also found two smaller issues, fixed here: the signature-collision filter, and a doubled page budget.
Not done here
COUNTof a one-hyperedge pattern still walks the candidates.