cldellow/sqlite-parquet-vtable

add in-extension filtering at row level

cldellow opened this issue · 2 comments

https://sqlite.org/vtab.html#xbestindex indicates that, for each constraint passed in, if you set omit to true, sqlite will avoid evaluating its internal checks and instead trust that the extension has done the appropriate checking.

This implies that xNext will skip non-responsive rows.

Implementing this should avoid a lot of overhead from unnecessary transitions between the sqlite VM and the extension.

Setting omit to 1 actually doesn't provide a big boost so let's ignore that.

That makes our task easier, since we don't have to filter things 100% correctly -- if a constraint is a pain to implement, just return all rows and let SQLite figure it out.

We still want to make xNext smart enough to skip rows for the easy constraints. This will also let us build the stats to do #6.

Added support for strings, ints, doubles, bools. Blobs not currently in, but could be added down the road.