Hi,

I am working on sqlite+rocksdb, i.e., using rocksdb as the back-end using
sqlite virtual table.
With xBestIndex and xFilter, we can pass the constraint information (e.g.,
those from WHERE clause) to virtual table (through struct
sqlite3_index_info), so that we can locate the cursor to narrow the search
space.
However, it does not provide information about functions used in SQL
queries.

For example,

> SELECT MAX(key) from Table tab;

The virtual table has no way to know the function MAX is called -- I want
this information, because I can get the max key quickly within the
underlying database. Similarly, I also need this for other certain types of
queries.

The virtual table provides xFindFunction to override functions (maybe this
can be used to pass some information).
But it seems only general functions can be override -- it has not effect on
aggregate functions.

Anyone knows how to pass function information to virtual table?
If sqlite does not provide this feature, what's the best way to tweak the
source code to implement this?

Thanks.

-C. Lin

Reply via email to