|< < 53 > >|

Estimating the cost of a plan

Table statistics

Estimating selectivity

select * from Employee where age between 50 and 55

Use the index or scan the table?

  • between 50 and 55 is covered by two buckets:
    • 48-52: 3/5 of 101 = 60.6
    • 53-57: 3/5 of 97 = 58.2
    • Total: 118.8

  • Selectivity is 118.8 / 710 = 16.7%.

Over 10%: Don't use the index!

|< < 53 > >|