Re: New design for FK-based join selectivity estimation - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: New design for FK-based join selectivity estimation
Date
Msg-id 87poqzg6f7.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: New design for FK-based join selectivity estimation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: New design for FK-based join selectivity estimation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:>> Attached is a reworked patch, mostly following the new design
proposal>> from this thread.
 
Tom> Comments and testing appreciated.

This blows up (see bug 14219 for testcase) in
match_foreign_keys_to_quals on the find_base_rel call(s) in the
following case:

If the query was produced by rule expansion then the code that populates
fkinfo includes FK references to the OLD and NEW RTEs, but those might not
appear in the jointree (the testcase for the bug is a DELETE rule where
NEW clearly doesn't apply) and hence build_simple_rel was not called
(causing find_base_rel to fail). Not sure what the right fix is.

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Should phraseto_tsquery('simple', 'blue blue') @@ to_tsvector('simple', 'blue') be true ?
Next
From: Tom Lane
Date:
Subject: Re: New design for FK-based join selectivity estimation