Re: Use of 'now' constant datatype in view to take advantage of partitioned table

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Use of 'now' constant datatype in view to take advantage of partitioned table
Дата
Msg-id CAF-3MvPiPvraush2m36eUzJ+ymj8CUkuwEO14eSptimtbsCDeQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use of 'now' constant datatype in view to take advantage of partitioned table  (Patrick Dung <patrick_dkt@yahoo.com.hk>)
Список pgsql-general
On 21 August 2014 11:36, Patrick Dung <patrick_dkt@yahoo.com.hk> wrote:
2.
now() is dynamic but it scan all the partitioned tables.

Most likely you partitioned on a timestamp without time zone, while now() returns a timestamp with time zone. The possible time zone difference causes that the database doesn't know in which partition to look.

In a similar vein, the function you defined to return your timestamp you marked 'immutable', which it should most definitely not be; time moves on, after all.

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: SELECT 'NOW()' - OK, SELECT 'CLOCK_TIMESTAMP()' - ERROR
Следующее
От: Birta Levente
Дата:
Сообщение: Re: POWA tool