Re: Partitions are not excluded in stored procedures

Поиск
Список
Период
Сортировка
От Ioannis Anagnostopoulos
Тема Re: Partitions are not excluded in stored procedures
Дата
Msg-id 4FCF1083.50504@anatec.com
обсуждение исходный текст
Ответ на Re: Partitions are not excluded in stored procedures  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
On 05/06/2012 17:55, Tom Lane wrote:
> Ioannis Anagnostopoulos<ioannis@anatec.com>  writes:
>> I came across the following problem. Say I have a select query that
>> given the appropriate where clauses it will only query the correct
>> partitioned tables and not all of them.  That can be examined by using
>> the EXPLAIN. However the same select query used in a stored procedure
>> will transverse all the tables regardless of the where clause parameters
>> passed by the user as variables of the stored procedure . Is there any
>> work around other than composing an EXECUTE "select ....."?
> Yeah, if the WHERE clauses that correspond to the partitioning
> constraints contain parameters, the planner can't prove the exclusions
> hold.  So you have to use EXECUTE to get a one-shot plan.  This will
> be better in 9.2 (which, basically, will automatically recognize that
> it needs to use one-shot plans).
>
>             regards, tom lane
When you say better in 9.2 you mean that we will be able to avoid the
EXECUTE, and the plan will be, more or less, calculated per call without
great performance hit?

Regards and thank you
Yiannis

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

Предыдущее
От: Ioannis Anagnostopoulos
Дата:
Сообщение: Partitions are not excluded in stored procedures
Следующее
От: "Matthias Howell"
Дата:
Сообщение: pg_upgrade missing