Re: Factoring where clauses through UNIONS take 2 - Mailing list pgsql-general

From Tom Lane
Subject Re: Factoring where clauses through UNIONS take 2
Date
Msg-id 3600.1051228109@sss.pgh.pa.us
Whole thread Raw
In response to Re: Factoring where clauses through UNIONS take 2  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Factoring where clauses through UNIONS take 2  (Jonathan Bartlett <johnnyb@eskimo.com>)
List pgsql-general
I said:
> In this particular case, since the qual doesn't actually touch the
> type-converted column, it would have been safe to push down, but the
> planner doesn't make this test on a per-qual basis: if there are type
> conversions anywhere in the UNION it just punts.

CVS tip has now had its consciousness raised on this point ;-).  Turns
out that it's not significantly more expensive to apply the test to
individual vars instead of having a blanket check on the whole query,
so I fixed it.

Jonathan will still need to put the explicit casts into his view for
use with 7.3.*, though.  He probably should do that anyway, because
even in 7.4 a restriction on the "type" column would not get pushed
down as desired if the literals are UNKNOWN type.

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: has_table_priviledge
Next
From: elein
Date:
Subject: Re: [SQL] rewriting values with before trigger