sqlite  perform  group by and order by  using   transient index,  
and   if   there isn't exist such an index,  sqlite will  create  the index and
store it  in its  a temporary file.

So I  think  the following  SQL statement won't   create  temporary file in 
disk.

create table tbl(a,b,c);
create index on  tbl(a);
create index on  tbl(b);

SELECT    B.a,B.b,B.c  FROM
 (SELECT  a,b  FROM tbl GROUP BY a) A 
INNER JOIN
(SELECT     b,c  FROM tbl  ORDER BY b)B 
ON  A.b=B.b

Because  both   group by  and order by  could make use of  appropriate  index .

But  in my  test,  temporary file appear.


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

Reply via email to