Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Query Tuning Help - Sum multiple columns
I have a fact table with multiple columns that need to be summed.
The sql is straight forward:
select col1, col2, col3, sum(col4+col5+col6) value1, sum(col6),
sum(col7), ....
from table1
group by col1, col2, col3, value1
order by col1, col2
The table has 171,000 rows, but the query takes 20 minutes to complete.
Is there a more efficient way to write a query like this?
Thanks,
Dennis Pessetto
DBA - The Regence Group
Received on Tue Oct 16 2007 - 01:28:34 CDT
![]() |
![]() |