Open cldellow opened 6 years ago
By providing a single string that specifies multiple values, this would also make it possible to express variadic IN
style queries in datasette's canned query feature.
ATM you need to do a slow/hacky workaround: instr(',35300027,35300028,', ',' || uid || ',')
-- would be much cleaner to write uid MATCH '35300027,35300028'
See discussion at #34.
SQLite handles
SELECT * FROM tbl WHERE col IN (a, b, c)
by unioning three queries (col = a, col = b, col c). The overhead to seek to a rowgroup and uncompress a large batch just for a single match is inefficient.Instead, let's implement the
MATCH
function. eg:This should support dynamically constructing the clause, e.g.:
Ideally we'd support integers, doubles and strings. Integers are highest priority since doubles are less likely to be used as a join key and strings have reasonable support via
LIKE
already.Also it'd be best to support this at both the row group and row level.