On 11 Sep 2010, at 5:38pm, Stephen Oberholtzer wrote:

> It would be an interesting attempt to try efficiently patching SQLite
> to recognize this situation and read data directly out of the index.

But I've been told many times that SQLite already does this.  For example, 
suppose you have the table

TABLE myTable

a       INTEGER
b       INTEGER
c       INTEGER
d       INTEGER
e       INTEGER

And you have the single index on (a,b,c,d)

If you do

SELECT a,b,c,d FROM myTable WHERE a=1 AND b=2 ORDER BY c

I was told that SQLite retrieved all the data needed by that SELECT from the 
index, because it was all available there, and therefore SQLite didn't have to 
go find the data from the table at all.

This means that SQLite already implements the sort of sub-TABLE that was 
discussed earlier: a copy of just a few columns of the original table.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to