pgsql: Fix booltestsel() for case where we have NULL stats but not MCV

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix booltestsel() for case where we have NULL stats but not MCV
Дата
Msg-id E1V1qxN-0004Rf-8G@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix booltestsel() for case where we have NULL stats but not MCV stats.

In a boolean column that contains mostly nulls, ANALYZE might not find
enough non-null values to populate the most-common-values stats,
but it would still create a pg_statistic entry with stanullfrac set.
The logic in booltestsel() for this situation did the wrong thing for
"col IS NOT TRUE" and "col IS NOT FALSE" tests, forgetting that null
values would satisfy these tests (so that the true selectivity would
be close to one, not close to zero).  Per bug #8274.

Fix by Andrew Gierth, some comment-smithing by me.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9f8254c18cd73404abce53d832723fe104caef14

Modified Files
--------------
src/backend/utils/adt/selfuncs.c |   22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix booltestsel() for case where we have NULL stats but not MCV
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix booltestsel() for case where we have NULL stats but not MCV