Re: partitioning for speed, but query planner ignores

Поиск
Список
Период
Сортировка
От David Rysdam
Тема Re: partitioning for speed, but query planner ignores
Дата
Msg-id 87fvsjst7r.fsf@loud.llan.ll.mit.edu
обсуждение исходный текст
Ответ на Re: partitioning for speed, but query planner ignores  (Bill Moran <wmoran@potentialtech.com>)
Список pgsql-general
On Wed, 2 Oct 2013 09:12:02 -0400, Bill Moran <wmoran@potentialtech.com> wrote:
> Last I looked, the partitioning mechanism isn't _quite_ as smart as could
> be desired.  For example:
> SELECT * FROM table WHERE objnum = 5; -- will not take advantage of partition
> You have to give the planner a little more hint as to the fact that it can
> take advantage of the partition:
> SELECT * FROM table WHERE (objnum % 2) = 1 AND objnum = 5;
> As silly as it seems, this is enough information for the planner to know
> that it only needs to scan one partition.

This seemed ridiculously silly until I thought about it. I guess it has
no way of "unwrapping" my constraint and figuring out what to do. Would
this also apply if I did ranges or is that a common enough constraint
that it *can* figure it out without me having to modify all my queries?

Вложения

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: partitioning for speed, but query planner ignores
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: [HACKERS] Who is pgFoundery administrator?