Re: why partition pruning doesn't work? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: why partition pruning doesn't work?
Date
Msg-id 30981.1528822481@sss.pgh.pa.us
Whole thread Raw
In response to Re: why partition pruning doesn't work?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: why partition pruning doesn't work?
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I think we DO hold relations open for the duration of execution
> (though not necessarily between planning and execution).  And there is
> code in RelationClearRelation to avoid changing rd_partkey and
> rd_partdesc if no logical change has occurred.

Testing with valgrind + RELCACHE_FORCE_RELEASE is sufficient to disprove
that, cf current results from lousyjack (which match my own testing).
The partkey *is* disappearing under us.

While I've not looked into the exact reasons for that, my first guess
is that the partitioned table is not held open because it's not one
of the ones to be scanned.  Are you prepared to change something like
that at this stage of the release cycle?

            regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: assert in nested SQL procedure call in current HEAD
Next
From: Tom Lane
Date:
Subject: Re: why partition pruning doesn't work?