You are right, I don't know why I didn't think to use explain query plan
command earlier. Its output shows exactly what is going on. An automatic
covering index is created.

Thank you very much.

On Wed, May 4, 2016 at 5:11 PM, Simon Slavin <slavins at bigfraud.org> wrote:

>
> On 4 May 2016, at 9:32pm, Nikolaos Tsikoudis <tsikudis at brandeis.edu>
> wrote:
>
> > I execute a query and I see that SQLite creates temporary data that are
> > never written to the disk and I am trying to understand what happens.
>
> Use the EXPLAIN QUERY PLAN command:
>
> <https://www.sqlite.org/eqp.html>
>
> It will show you how SQLite decides to best execute your query.
>
> > select
> >    sum()
> > from
> >    table1 t1
> >    table2 t2
> > where (
> >    t1.a = t2.a and ...
> > ) or (
> >    t1.a = t2.a and ...
> > ) or (
> >    t1.a = t2.a and ...
> > );
>
> Do you have indexes on table1.a and table2.a ?  If not, then SQLite might
> decide it has to make up a temporary index in order to process your query
> quickly.  That would be a 'transient indices' as you describe in your
> question.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to