SQLite Forum

Support custom indexes, and indexes on virtual tables
Login
Hello,

I'm thinking about creating a virtual table that can store documents (think json not files). 

However if I were able to simply implement a custom index without a virtual table then this would suffice, it would work similar to the current virtual table interface and sqlite could call `xBestIndex` or a similarly named function for the index to see if it should be used or not for the expression. It would ideally allow the index to decide if it should 1) be matched for the expression 2) give sqlite information on how many operations would be required to use the index.

Ideally a user would create a custom index like using something to similar to `CREATE INDEX yadayada USING whatever(options) ON tbl(expr, ...);` or `CREATE INDEX yadayada ON tbl(expr, ...) USING whatever(options);`, whatever being the named custom index module that was loaded with options being passed optionally. When no options are passed simply `USING whatever ON` should suffice.

At the same time it would be nice to be able to create an index on a virtual table using `CREATE INDEX` and the virtual table should implement a function(s) to allow creating a custom index or handling index creation.

Would it be possible to implement these features? How much would be required in doing so?