-
very slow performance when using sum and group by
Hi,
I have a query which runs very very slow, it is doing a full table scan on tab1:
select sum(col1)
from tab1
where col2 = 'x'
group by col3
There is an index on (col2, col3), the following query runs very fast:
select *
from tab1
where col2 = 'x'
I tried to change the index to (col1, col2, col3), but there is no improvement by doing that, how can I improve the performance of this query?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|