Re: PATCH: use foreign keys to improve join estimates v1

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, David Steele <david(at)pgmasters(dot)net>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: use foreign keys to improve join estimates v1
Date: 2016-04-03 21:44:59
Message-ID: CANP8+j+BVL-VisDjzQACgK-csxPX5aX7SKH-GS6R1y5g+2txTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3 April 2016 at 22:09, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:

> On 04/03/2016 10:06 PM, Simon Riggs wrote:
>
>> On 14 March 2016 at 19:42, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com
>> <mailto:tomas(dot)vondra(at)2ndquadrant(dot)com>> wrote:
>>
>> ...
>
>>
>>
>> I'd like to split this into 2 patches
>> 1) Add FK info to relcache
>> 2) use FK info in planner
>>
>> Would the credit for this be 1) Tomas, 2) Tomas + David ?
>>
>
> I could split the patch like that, but I don't quite see the point. The
> two parts will not overlap at all, so not making reviews any simpler. So
> the only reason for such split seems to be be different credits, but would
> we actually commit the pieces independently? Not sure about that.

Oh sorry. Reason for split was because adding the FK info to relcache was a
very solid addition, whereas we might imagine some churn around the planner
aspects.

I'd be inclined to see a little more explanatory docs on this.
>>
>
> That's probably a good idea. Do you have any particular place for the docs
> in mind?

Detailed comments in the planner part of the patch. The discussion around
this patch isn't reflected enough in the patch.

Have we done any tests on planning overhead for cases where multiple
>> FKs exist?
>>
>>
> I have done some benchmarks initially, and haven't measured any noticeable
> impact. But the code changed since than, so I'll redo that and post some
> results.

Thanks

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Shulgin 2016-04-03 22:03:32 Re: More stable query plans via more predictable column statistics
Previous Message Simon Riggs 2016-04-03 21:41:53 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby