Index Range scan cost ?
448778Dec 28 2008 — edited Dec 29 2008Why the effective index selectivity of index range scan is calculated this way
(highendval -lowendval)/(highvalue -lowvalue)+ 2/num_distinct ?why its not 1/num_distinct which is used in case of equality predicate?
Second question is why the effective index selectivity calculation for a composite index is calculated differently if there is range scan on the leading column of the indexes and though there are predicates available in the where clause for other column in the index why the cost of those predicates is not included in the index range scan.
e.g I have composite index on (n1,n2,n3) and the where clause is
n1 between 6 and 9 and
n2=3 and
n3='a'
why only the effective index selectivity of the index range scan for the predicate n1 is used in finding effective Index selectivity , but all n1,n2 and n3 are considered in getting effective table selectivity(which makes sense)
P.S:- I am refering Cost based fundamental by Jonathan Lewis.
Edited by: user445775 on Dec 28, 2008 11:06 AM