pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: david.rowley@2ndquadrant.com
Cc: tgl@sss.pgh.pa.us
Cc: simon@2ndquadrant.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Collect and use multi-column dependency stats
Date: Thu, 06 Apr 2017 15:03:16 +0900 (Tokyo Standard Time)
Message-ID: <20170406.150316.128378012.horiguchi.kyotaro@lab.ntt.co.jp> (raw)
In-Reply-To: <CAKJS1f8Um=BvRmgcb3u6ze1q1xL7A1VKTVF9s2R1_UfRqx8q5w@mail.gmail.com> <CAKJS1f_gB=gyZn8wMw0v8uCKD1nYeWyNYCXKz=+Oo0yR4RRyiA@mail.gmail.com>
References: <5801.1491435183@sss.pgh.pa.us>
	<CAKJS1f_gB=gyZn8wMw0v8uCKD1nYeWyNYCXKz=+Oo0yR4RRyiA@mail.gmail.com>
	<CAKJS1f8Um=BvRmgcb3u6ze1q1xL7A1VKTVF9s2R1_UfRqx8q5w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

At Thu, 6 Apr 2017 13:10:48 +1200, David Rowley <david.rowley@2ndquadrant.com> wrote in <CAKJS1f8Um=BvRmgcb3u6ze1q1xL7A1VKTVF9s2R1_UfRqx8q5w@mail.gmail.com>
> On 6 April 2017 at 13:05, David Rowley <david.rowley@2ndquadrant.com> wrote:
> > I tested with the attached, and it does not seem to hurt planner
> > performance executing:
> 
> Here's it again, this time with a comment on the
> find_relation_from_clauses() function.

It seems to work as the same as the previous version with
additional cost to scan over restrict clauses. But separate loop
over clauses is additional overhead in any cases even irrelavant
to functional dependency.  The more columns are in the relation,
the longer time bms_get_singleton_member takes. Although I'm not
sure how much it hurts performance and I can't think of a good
alternative right now, I think that the overhead should be
avoided anyhow.

At Thu, 6 Apr 2017 13:05:24 +1200, David Rowley <david.rowley@2ndquadrant.com> wrote in <CAKJS1f_gB=gyZn8wMw0v8uCKD1nYeWyNYCXKz=+Oo0yR4RRyiA@mail.gmail.com>
> > And you measured the overhead of doing it the other way to be ... ?
> > Premature optimization and all that.
> 
> I tested with the attached, and it does not seem to hurt planner
> performance executing:

Here, bms_singleton_member takes longer time if the relation has
many columns and there's a functional dependency covering the
columns at the very tail. Maybe only two are not practical for
testing.

Even if it doesn't impact performance detectably, if only one
attribute is needed, an AttrNumber member in context will be
sufficient. No bitmap operation seems required in
dependency_compatible_walker and it can bail out by the second
attribute.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



-- 
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: <20170406.150316.128378012.horiguchi.kyotaro@lab.ntt.co.jp>
Permalink:  ../20170406.150316.128378012.horiguchi.kyotaro@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/20170406.150316.128378012.horiguchi.kyotaro@lab.ntt.co.jp

 · 

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: horiguchi.kyotaro@lab.ntt.co.jp, david.rowley@2ndquadrant.com, tgl@sss.pgh.pa.us, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Collect and use multi-column dependency stats
  In-Reply-To: <20170406.150316.128378012.horiguchi.kyotaro@lab.ntt.co.jp>
  References: <5801.1491435183@sss.pgh.pa.us> <CAKJS1f_gB=gyZn8wMw0v8uCKD1nYeWyNYCXKz=+Oo0yR4RRyiA@mail.gmail.com> <CAKJS1f8Um=BvRmgcb3u6ze1q1xL7A1VKTVF9s2R1_UfRqx8q5w@mail.gmail.com> <20170406.150316.128378012.horiguchi.kyotaro@lab.ntt.co.jp>

* 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