Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Simple Order of Magnitude counts.. do they exist ?

668023Oct 30 2008 — edited Nov 2 2008
I don't normally deal with SQL, so apologies if what I am asking is dumb / obvious.

I have a table [orders] with approx 300,000,000 rows. It is quite wide (approx 500b on avg).

there is a unique index [idx_a] on [order_id , order_dt, store_chain, store_id]
there is another index [idx_b] on [order_dt, ...several other columns...]

At a high level I want to do something like:

SELECT TO_CHAR(order_dt, 'YYYY'), COUNT(*)
FROM orders
GROUP BY order_dt

But I am not really interested in the exact count, I am more interested in an order of magnitude summary. The system is online and live and continually accepting orders from the various outlets (approx 20 per minute). I have tried running the above query, in a test environment but it does not complete inside of 15 minutes.

Is there a smarter way to do this ?
This post has been answered by Randolf Geist on Nov 2 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2008
Added on Oct 30 2008
10 comments
583 views