On 18 April 2013 22:42, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> One could imagine adding planner logic that would make inferences of a
> similar sort for equalities combined with inequalities, but it would be
> vastly more complicated, and would provide useful results in vastly
> fewer queries, than the equality-propagation logic. So don't hold your
> breath waiting for something like that to happen.
I'll take note that we need to make partitioning work for merge joins also.
On a more general note, it would be good to be able to look at the
starting value from the driving table of the join and use that as a
constraint in the scan on the second table. We rely on that mechanism
for nested loop joins, so we could do with that here also.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services