select doc_type, count(doc_type) doc_count from doc_master WHERE
sent_date between '01-AUG-01' AND '31-AUG-01' group by doc_type ;
The doc_master has about 40 million tables .there is an index on sent_date .the above querry uses the index also .
the above querry runs for about 16 min .Any suggestions to make it faster ...
First, it is important to know the database type:
You can try:
- Parallel Query
- Partitioned Table
- Additional BITMAP index on doc_type
Add doc_type to existing B*Tree index (the one that has sent_date) This field can either be first or second. You will want to seriously look at how your indexes are used to see if dt,sd or sd,dt or sd,dt/dt or dt,sd/sd will work best for you
And since this is a SQL question, I'm moving it to the Development forum.
Click Here to Expand Forum to Full Width