pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Collect and use multi-column dependency stats
Date: Wed, 05 Apr 2017 19:33:03 -0400
Message-ID: <5801.1491435183@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f8eSgpHhZOMYnhmYv0cSh4tGfKvdq=B8g+WJFVgaXzzfw@mail.gmail.com>
References: <E1cvt3y-0008R4-5z@gemulon.postgresql.org>
	<4188.1491432537@sss.pgh.pa.us>
	<CAKJS1f8eSgpHhZOMYnhmYv0cSh4tGfKvdq=B8g+WJFVgaXzzfw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

David Rowley <david.rowley@2ndquadrant.com> writes:
> On 6 April 2017 at 10:48, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The buildfarm is unhappy about the fact that this changed the API
>> for clauselist_selectivity().  I am not convinced that that change
>> was a good idea, so before telling FDW authors that they need to
>> change their code, I'd like to hear a defense of the API change.

> Because varReliId is often passed in as 0, and that meant we'd have to
> write some code to check of the clause was made up of RestrictInfos
> from a single relation or not, and look for extended stats on that
> singleton rel.

Generally, if it's passed as zero, that's a good clue that the clause
*is* a join clause.  In any case, this defense fails to address my
other question, which is what's going to happen to this API when you
want to use extended stats in join-clause estimates, which I'd expect
to surely happen before very long.

Also, I find it hard to believe that a bms_get_singleton_member call is
going to be material in comparison to all the work that will be invoked
indirectly via whatever selectivity estimation function gets called for
each clause.  Even a single catcache fetch would swamp that.

So no, you have not convinced me that this isn't a broken design.

> FWIW, I found this function being called 72 times in a 5 way join
> search problem.

And you measured the overhead of doing it the other way to be ... ?
Premature optimization and all that.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (14+ messages)  latest in thread

Message-ID: <5801.1491435183@sss.pgh.pa.us>
Permalink:  ../5801.1491435183@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5801.1491435183@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Collect and use multi-column dependency stats
  In-Reply-To: <5801.1491435183@sss.pgh.pa.us>
  References: <E1cvt3y-0008R4-5z@gemulon.postgresql.org> <4188.1491432537@sss.pgh.pa.us> <CAKJS1f8eSgpHhZOMYnhmYv0cSh4tGfKvdq=B8g+WJFVgaXzzfw@mail.gmail.com> <5801.1491435183@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox