Support and optimize wildcard joins (`text LIKE pattern_column`)
Is your feature request related to a problem?
QuestDB cannot currently join a text column against patterns stored in another table because the right-hand side of LIKE must be a constant or bind variable:
SELECT l.ts, l.device_id, r.fault_class
FROM device_logs l
JOIN fault_rules r ON l.message LIKE r.pattern;This would be useful for high-volume IoT fault classification, FIX/venue error normalization, trade-surveillance rules, and news-to-instrument tagging.
Describe the solution you'd like.
Support column-to-column LIKE, with an adaptive wildcard join for larger pattern sets. The approach in Teach Your DBMS to LIKE Strings builds an Aho–Corasick automaton over the pattern relation and uses positional constraints for SQL % and _, probing each text once instead of evaluating every text/pattern pair.
A nested-loop matcher could remain the fallback for small or adversarial pattern sets. Initial scope could be a case-sensitive inner join over VARCHAR, with other types and outer/semi/anti joins added later.
Reference implementation: https://github.com/lamduynguyen/wildcard-join
Describe alternatives you've considered.
Application-side rule matching or expanding rules into separate constant filters. Both lose SQL composability and require moving or repeatedly scanning data.
Full Name:
Nick Woolmer
Affiliation:
QuestDB
Source: questdb/questdb