Subject | Confusing selectivity for newly added index? |
---|---|
Author | Kjell Rilbe |
Post date | 2013-08-19T21:39:44Z |
Hi,
I have a table with around 170 million records. I just added a new
nullable column and an index on it. After having entered values into the
new column in only a few of the records, perhaps a few hundred or
thousand, I recomputed the selectivity for the new index.
I was astonished to see it set to 0.065 or something like that. Since
only a small number of records have a value, I would have expected a
much lower figure.
Or is selectivity computed only on non-null rows, and null rows entierly
left out of the calculation?
Regards,
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
I have a table with around 170 million records. I just added a new
nullable column and an index on it. After having entered values into the
new column in only a few of the records, perhaps a few hundred or
thousand, I recomputed the selectivity for the new index.
I was astonished to see it set to 0.065 or something like that. Since
only a small number of records have a value, I would have expected a
much lower figure.
Or is selectivity computed only on non-null rows, and null rows entierly
left out of the calculation?
Regards,
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64