Re: Strange behavior of function date_trunc

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange behavior of function date_trunc
Дата
Msg-id 4175001.1620328453@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Strange behavior of function date_trunc  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Ответы Re: Strange behavior of function date_trunc  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Список pgsql-general
Pavel Luzanov <p.luzanov@postgrespro.ru> writes:
> One thing remains unclear.
> Why, if a scalar subquery is used to materialize the function value(even 
> constant), then an inefficient index scan is chosen:

The scalar subquery prevents the planner from seeing the actual
comparison value, so it falls back to a default selectivity estimate
(notice the fairly bad rowcount estimate).  I'm a bit surprised that
that would end in choosing an indexscan over a seqscan, but that
might be a consequence of the small random_page_cost you're using.

            regards, tom lane



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

Предыдущее
От: Pavel Luzanov
Дата:
Сообщение: Re: Strange behavior of function date_trunc
Следующее
От: Adrien Nayrat
Дата:
Сообщение: Re: "invalid contrecord" error on replica