Bo Lin <[EMAIL PROTECTED]> 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) >
Try 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 <[EMAIL PROTECTED]>