Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Query Tuning Help - Sum multiple columns

Query Tuning Help - Sum multiple columns

From: DP <dxpesse_at_gmail.com>
Date: Tue, 16 Oct 2007 06:28:34 -0000
Message-ID: <1192516114.645036.221070@z24g2000prh.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US