SQL Tuning
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: SQL Tuning

  1. #1
    Join Date
    May 2000
    Location
    maryland hights
    Posts
    20

    Lightbulb SQL Tuning

    I have table which has 12 Mill rows, when I try to query the database with below sql it is doing the full table scan.

    Select * from abc_tbl where rec_stat='C'

    This column “rec_stat” having the bit map index even thus it is doing full table scan. Any suggestions to avoid the full table scan.
    Nallamothu

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    why are you assuming a full table is bad?

  3. #3
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    As a rule of thumb, if C represents more than ~4% of the table, then a tablescan is more efficient.
    Christopher R. Long
    ChrisRLong@HotMail.Com
    But that's just my opinion. I could be wrong

  4. #4
    Join Date
    May 2000
    Location
    maryland hights
    Posts
    20

    Lightbulb

    Quote Originally Posted by davey23uk
    why are you assuming a full table is bad?
    Reason is it need to go thru the entire 13 mill rows right ? so i think it takes long time.
    Nallamothu

  5. #5
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    so why is that bad?

  6. #6
    Join Date
    May 2000
    Location
    maryland hights
    Posts
    20
    Quote Originally Posted by davey23uk
    so why is that bad?
    As Christopher R. Long said I have C records are more than 4 % of the table then i think i'm fine .let it run the full table scan.

    Thank you all for your time.
    Nallamothu

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