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>)
Список pgsql-admin


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
Дата:
Сообщение: trying to build immutable function in index
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: trying to build immutable function in index