Re: hashjoin chosen over 1000x faster plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: hashjoin chosen over 1000x faster plan
Date
Msg-id 25224.1192054139@sss.pgh.pa.us
Whole thread Raw
In response to Re: hashjoin chosen over 1000x faster plan  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-performance
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> I'm not sure why it looks at the slow option at all; it seems like a remain=
> ing weakness in the OUTER JOIN optimizations.

I think that comes mostly from the fact that you've got non-nullable
targetlist entries in the definition of the CaseTypeHistEvent view.
Those prevent that view from being flattened into the upper query when
it's underneath an outer join, because the current variable-evaluation
rules provide no other way to ensure that the values are forced NULL
when they need to be.  This is something we should fix someday but don't
hold your breath waiting --- it's likely to take some pretty fundamental
rejiggering of the planner's handling of Vars.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: hashjoin chosen over 1000x faster plan
Next
From: "Kevin Grittner"
Date:
Subject: Re: hashjoin chosen over 1000x faster plan