Skip site navigation (1) Skip section navigation (2)

Partitions are not excluded in stored procedures

From: Ioannis Anagnostopoulos <ianagn(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Partitions are not excluded in stored procedures
Date: 2012-06-05 15:54:59
Message-ID: 4FCE2BD3.1020803@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi there,

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 ....."?

Kind Regards
Yiannis


Responses

pgsql-novice by date

Next:From: Ioannis AnagnostopoulosDate: 2012-06-05 15:56:22
Subject: Partitions are not excluded in stored procedures
Previous:From: Antonio Carlos Salzvedel Furtado JuniorDate: 2012-06-04 21:10:03
Subject: Re: Changing tuning parameters with EXPLAIN

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group