On Sat, Sep 11, 2010 at 8:54 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> 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.
>

Simon, I think this is because the index is forced when you use ORDER BY so
if the index matches it, this is the only way to do the retrieval
effectively. But when you tell you want some field(s) without order by and
they're also contains in the index, sqlite optimizer would recognize there
would be fewer reads in case of the index, but I suppose it currently
doesn't do this. I think there might be some indirect logic behind this or
maybe this thing with size difference not so obvious. For example  if the
field mentioned is TEXT and it's much more larger than all other fields
together,the benefits of using the index for retrieval are not so great,
although index at least should not be worse in any situation

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

Reply via email to