Re: trying to build immutable function in index

Поиск
Список
Период
Сортировка
Искать
От
Rui DeSousa
Тема
Re: trying to build immutable function in index
Дата
Msg-id
E712B033-4FC4-408A-8794-E3A0AC593D18@crazybean.net
Ответ на
Список
Дерево обсуждения
trying to build immutable function in index Mark Steben <mark.steben@drivedominion.com>
Re: trying to build immutable function in index "David G. Johnston" <david.g.johnston@gmail.com>
Re: trying to build immutable function in index Rui DeSousa <rui@crazybean.net>


On Jun 2, 2020, at 5:42 PM, Mark Steben <mark.steben@drivedominion.com> wrote:

AND value::date >= date_trunc('MONTH'::text, 'now'::text::date - '1 mon'::interval month)

I don’t think value::date is immutable; it will return a different date depending on your timezone. 

Also this is also not immutable:  'now'::text::date - '1 mon'::interval month 

You would have records indexed that should not be indexed the next month basically invalidating itself each month.


В списке pgsql-admin по дате отправления
От: Mark Steben
Дата:
От: David G. Johnston
Дата:
FAQ