Re: Partitioned tables in queries

Поиск
Список
Период
Сортировка
От Andrew Hammond
Тема Re: Partitioned tables in queries
Дата
Msg-id 1153860508.907395.248520@h48g2000cwc.googlegroups.com
обсуждение исходный текст
Ответ на Re: Partitioned tables in queries  (Kevin Keith <kkeith@borderware.com>)
Список pgsql-performance
> 2. I found that using the now() function - and arbitrary interval will
> produce a different execution plan that using a specific date. For example:
>     assuming the current time is 16:00:
>     a) where start_date > now() - interval '4 hours' scans all child tables.
>     b) where start_date > '2006-07-21 12:00:00' only scans the child
> table with today's data.
>
> So am I to assume that the value in the query must be a constant, and
> cannot be a result of a built-in function in order for
> constraint_exclusion to work correctly?

Have you tried WHERE start_date > (SELECT now() - interval '4 hours')?
Certainly using the constant will allow CBE to work. I think that a
subquery might too.


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

Предыдущее
От: Markus Schaber
Дата:
Сообщение: Re: BUG #2543: Performance delay acrros the same day
Следующее
От: nuggets72@free.fr
Дата:
Сообщение: loading increase into huge table with 50.000.000 records