Jerry wrote:
> Assuming I want to compute the average value of all keys, how to write the
> query for this using match?
>
> For example, if I write SQL in this way
>
>> SELECT avg(key) From table WHERE key MATCH('avg');
>
> with MATCH info, the virtual table is able to know the query is looking for
> average value for the keys.
> Now, assume the virtual table is able to compute the average faster than
> SQLite, after I get the average value, how can I return the result
> immediately without SQLite going through the aggregator avg()?

You could return a single row that already contains the average value.

> What are your queries like when you "pass arbitrary specialized queries
> directly to my virtual table"?

You would have to put everything into the MATCH operand.


The virtual table interface is not really designed for such things;
it works best when you have some custom index that merely reduces
the number of rows to be returned.


Regards,
Clemens

Reply via email to