Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> sum table
Hi !
I have a very big table with 10 million transactions, that contains information about our sales (items, quantities, amounts, etc).
We run a lot af big (slow) querys, to get sales information.
A query could look like this:
Select st.itemnumber, sum(st.qty), sum(st.amount) from salestrans st group by st.itemnumber, To_Char(st.salesdate,'YYYY-MM')
This (simplified) query gives us the monthly sale for a specific article. Due to the size of the table, this query is slow.
Is there a method to make tables in oracle, maintaining the sums, for a specific itemnumber, for a specific period ???
Can it be done with a materialized view, a trigger, or in some other way???
We use oracle 10g.
Regards,
Ole
Received on Wed Aug 31 2005 - 09:54:13 CDT