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.

Reply via email to