Re: PATCH: use foreign keys to improve join estimates v1 - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: PATCH: use foreign keys to improve join estimates v1
Date
Msg-id CANP8+j+aXw2_RbQKL1va5YvH=12rE=XT=kqFOwiCnouJjh4OnQ@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: use foreign keys to improve join estimates v1  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: PATCH: use foreign keys to improve join estimates v1  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On 3 April 2016 at 22:44, Simon Riggs <simon@2ndquadrant.com> wrote:
 
Detailed comments in the planner part of the patch. The discussion around this patch isn't reflected enough in the patch.

I think we should record that the planner uses the constraint, even if the constraint is not yet valid, per DDL.

The rel cache code you're adding uses a flag called "rd_fkeyvalid" which indicates that the relcache is correctly filled. That is confusing, since it has nothing to do with the concept of constraint validity. We should rename that to rd_fkeycachefilled or similar.

ISTM that the FKey info added to the rel cache would be useful for many optimizations, hence why I think we should commit that separately, whether or not the specific optimization for the other half of the patch is accepted or later modified or revoked. Objections?

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Proposal: Generic WAL logical messages
Next
From: Fujii Masao
Date:
Subject: Re: Support for N synchronous standby servers - take 2