Re: Slow execution time when querying view with WHERE clause

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow execution time when querying view with WHERE clause
Дата
Msg-id 4738.1101277883@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Slow execution time when querying view with WHERE clause  (Mike Mascari <mascarm@mascari.com>)
Ответы Re: Slow execution time when querying view with WHERE clause  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-performance
Mike Mascari <mascarm@mascari.com> writes:
> Tom Lane wrote:
>> Why is it so completely off about the selectivity of the IS NULL clause?

> I think this is a bug in ANALYZE not constructing statistics for columns
> whose data is entirely NULL:

Um ... doh ... analyze.c about line 1550:

    /* We can only compute valid stats if we found some non-null values. */
    if (nonnull_cnt > 0)
       ...

There's a bit of an epistemological issue here: if we didn't actually
find any nonnull values in our sample, is it legitimate to assume that
the column is entirely null?  On the other hand, if we find only "3" in
our sample we will happily assume the column contains only "3", so I
dunno why we are discriminating against null.  This seems like a case
that just hasn't come up before.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Slow execution time when querying view with WHERE clause
Следующее
От: "BBI Edwin Punzalan"
Дата:
Сообщение: FW: Index usage