Re: Table performance with millions of rows (partitioning)

Поиск
Список
Период
Сортировка
От pinker
Тема Re: Table performance with millions of rows (partitioning)
Дата
Msg-id 1514427734055-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: Table performance with millions of rows (partitioning)  (Robert Blayzor <rblayzor.bulk@inoc.net>)
Список pgsql-performance
No, it's unfortunately not possible.
Documentation says in Caveats part:

/Constraint exclusion only works when the query's WHERE clause contains
constants (or externally supplied parameters). For example, a comparison
against a non-immutable function such as CURRENT_TIMESTAMP cannot be
optimized, since the planner cannot know which partition the function value
might fall into at run time.

Keep the partitioning constraints simple, else the planner may not be able
to prove that partitions don't need to be visited. Use simple equality
conditions for list partitioning, or simple range tests for range
partitioning, as illustrated in the preceding examples. A good rule of thumb
is that partitioning constraints should contain only comparisons of the
partitioning column(s) to constants using B-tree-indexable operators./

Even making a function in SQL or plpgsql and declaring it as immutable will
not help. Postgres will always check against all the partitions. It's not
enough "simple" for the planner.




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html


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

Предыдущее
От: Robert Blayzor
Дата:
Сообщение: Re: Table performance with millions of rows (partitioning)
Следующее
От: Robert Blayzor
Дата:
Сообщение: partitioning an existing table