Re: strange pg_stats behaviour?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: strange pg_stats behaviour?
Дата
Msg-id 195.1038672301@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: strange pg_stats behaviour?  (Hubert depesz Lubaczewski <depesz@depesz.pl>)
Ответы Re: strange pg_stats behaviour?  (Hubert depesz Lubaczewski <depesz@depesz.pl>)
Список pgsql-general
Hubert depesz Lubaczewski <depesz@depesz.pl> writes:
>> The planner doesn't know what value data_off will be compared to at
>> runtime, so it has to fall back on a default selectivity estimate.

> strange - is there no way we can "teach" him, that this is a constant. i
> mean now() - '31 days'::interval will be exactly the same for all rows
> of auction,

It knows that.  What it doesn't know is how many rows of the table the
query is going to select, and that is exactly the thing it needs to know
to choose seqscan vs. indexscan.

            regards, tom lane

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

Предыдущее
От: Christoph Dalitz
Дата:
Сообщение: Re: ALTER TABLE & COLUMN
Следующее
От: "Han Holl"
Дата:
Сообщение: Re: Memory leak with palloc