Re: optimizing constant quals within outer joins

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Phil Frost <indigo(at)bitglue(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: optimizing constant quals within outer joins
Date: 2006-07-01 22:55:19
Message-ID: 18508.1151794519@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> I note that the rowcount is not altered by the one-time filter. Is this
> an issue? I imagine the problem is not being able to estimate the
> number of rows that pass the filter.

That's intentional. The filter is either going to pass all or none of
the rows, not some fraction of them. It clearly isn't very reasonable
to guess that it will pass none of them (except if the qual is actually
constant FALSE).

> I also wonder whether it wouldn't be better in this case to apply each
> filter to each arm of the merge join.

Uh, why? For the most part, I'd think the higher you can put the filter
in the plan tree, the better.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-07-02 00:48:21 Re: optimizing constant quals within outer joins
Previous Message Alvaro Herrera 2006-07-01 22:46:39 Re: optimizing constant quals within outer joins