DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: sql statement

  1. #1
    Join Date
    Sep 2000
    Posts
    384
    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 ...
    Radhakrishnan.M

  2. #2
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    Several, actually.

    First, it is important to know the database type:

    DSS
    -----
    You can try:
    - Parallel Query
    - Partitioned Table
    - Additional BITMAP index on doc_type

    OLTP
    ------
    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

    HTH,

    - Chris
    Christopher R. Long
    ChrisRLong@HotMail.Com
    But that's just my opinion. I could be wrong

  3. #3
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    And since this is a SQL question, I'm moving it to the Development forum.

    - Chris
    Christopher R. Long
    ChrisRLong@HotMail.Com
    But that's just my opinion. I could be wrong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width