RE: full-scan vs index for "small" tables

  • From: Wolfgang Breitling <breitliw@xxxxxxxxxxxxx>
  • To: Laimutis.Nedzinskas@xxxxxxxxxxxxx
  • Date: Thu, 29 Jun 2006 05:44:16 -0600

At 03:20 AM 6/29/2006, Laimutis Nedzinskas wrote:


I can illustrate my point using one example (which seems to be one the the biggest CBO issues actually, discussed many times before):


I have a "select where type='OPENED' "

No need to say that type='OPENED' is 0.1% of all records, the rest are 'CLOSED'.

I built a histogram. Value 'OPENED' happened not to be there because... the were no records with type='OPENED' at the time. Plan was full scan of course.

That is not my experience at all. If the value in the predicate is NOT in the (frequency) histogram then in my experience hat is synonymous for "very rare" for the CBO and it uses the index.
From all you are saying I get the impression that you are using a different CBO from the one I am using.



Regards

Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com

Other related posts: