Re: Þ [sqlite] About Index using

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Þ [sqlite] About Index using

D. Richard Hipp
Bo Lin <[hidden email]> wrote:

>  The Sql looks like
>      select x, y, sum(z)/1000 as bw from aa where        
>          a=1 and b=1 and
>         c =1 and d= 6 group by x, y having count(*) > 1 order by bw desc  
>         limit 10
>  1)  create index 1 on  aa (d)
>  2)  create index 2 on  aa (a,b,c,d)


   CREATE INDEX idx3 ON aa(a,b,c,d,x,y);

Or even better:

   CREATE INDEX idx4 ON aa(a,b,c,d,x,y,z);

D. Richard Hipp <[hidden email]>