On 15 Apr 2012, at 1:31pm, Steinar Midtskogen <[email protected]> wrote:

> Another question about max()/min() optimisation.  Is there a way I can
> implement a virtual table so that max()/min() of a sorted
> (incrementing) column (which could be an integer primary key in a
> regular table) gets fast?

The max() and min() functions work instantly if the columns they're looking at 
are indexed.  They simply find the first or last entry in the index.  So when 
defining your virtual table routines, just make sure your key columns have an 
index, and that your xBestIndex method finds the right index.

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to