pg.ddx.io  pgsql-hackers@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: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Performance improvement for joins where outer side is unique
Date: Thu, 07 Apr 2016 10:46:26 -0400
Message-ID: <16003.1460040386@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f_BxfNe3ixfz4S-g2RTodvjk82edcv9O9WtBqc9eUbWSA@mail.gmail.com>
References: <20150320.121140.148610378.horiguchi.kyotaro@lab.ntt.co.jp>
	<CAPpHfdviphQFjk-gaGZGGxLAyt=YuVdJLnntsxOKnU296s9u-Q@mail.gmail.com>
	<CAKJS1f-=1y0-f5FFV2_r7LtS+CL2Lw-nhJjXB3O_0FmBqnK=3A@mail.gmail.com>
	<27152324.eFKJb4Khb5@dinodell>
	<8608754a32d1325c2f83ba8b1df71585@xs4all.nl>
	<55DA1F9F.5040204@2ndquadrant.com>
	<CAKJS1f-9UTo6fA+h8rojd30CujSKscZamLn5YnKw5+ASbV0Wwg@mail.gmail.com>
	<5085.1440375543@sss.pgh.pa.us>
	<CAKJS1f_8hrzTDCu0pwERWj_dLZu-6DYFQJAtNT+vM6UeOn0kHw@mail.gmail.com>
	<8907.1440383377@sss.pgh.pa.us>
	<CAKJS1f8JCt15ngEP8sZO-JYYT8mS6HUP_CT0T6S_0ogk1kQt+Q@mail.gmail.com>
	<CAKJS1f_4hm3qwKeHYKftd+BQuYBgdNR+rk+XP_JW9EY-ALHZbQ@mail.gmail.com>
	<56718B15.6060507@2ndquadrant.com>
	<CAKJS1f_i7dGh9ytc0DuaX3JJaN7Gp9AGXNbdtWjj0PkPzNzUeg@mail.gmail.com>
	<5671FF0D.2010403@2ndquadrant.com>
	<CANP8+j+vxfEf3dqhnzKAnDopnnUM-Zjb90gNT=haEQNQePj9Mw@mail.gmail.com>
	<CAKJS1f8MpcL4_oS+n-vmnisd_8OMuZR2vyLETOF7ABSLk_iNZg@mail.gmail.com>
	<56A25A72.2090505@2ndquadrant.com>
	<13653.145773197! 8@sss.pgh.pa.us>
	<16023.1457736190@sss.pgh.pa.us>
	<CAKJS1f8S6FH_eH71SXmo_m2ChSU8LL75pf5cpN4TH=ZQQ0dENg@mail.gmail.com>
	<30364.1459529562@sss.pgh.pa.us>
	<CAKJS1f8naKkOueF0yRaTPzErzyLHjcOCwKvVnr5a4rv4doNzHw@mail.gmail.com>
	<CAKJS1f_TwwnJoXFgmwY39L81u9e6HiRuO1dnnCy2EFuHLaeYCQ@mail.gmail.com>
	<21641.1459958757@sss.pgh.pa.us>
	<CAKJS1f9OrAkVywOvk5OhCoXOssGUmtYOQyhU8jFr_bZL+Xn6zQ@mail.gmail.com>
	<CAKJS1f_BxfNe3ixfz4S-g2RTodvjk82edcv9O9WtBqc9eUbWSA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

David Rowley <david.rowley@2ndquadrant.com> writes:
> I've attached an updated patch which introduces JOIN_INNER_UNIQUE and
> JOIN_LEFT_UNIQUE. So unique inner joins no longer borrow JOIN_SEMI.

OK.

> In EXPLAIN, I named these new join types "Unique Inner" and "Unique
> Left".

Hm.  I'm back to being unhappy about the amount of churn introduced
into the regression test outputs by this patch.  I wonder whether we
could get away with only mentioning the "unique" aspect in VERBOSE
mode.

I'm also a bit suspicious of the fact that some of the plans in
aggregates.out changed from merge to hash joins; with basically
no stats at hand in those tests, that seems dubious.  A quick look
at what the patch touched in costsize.c suggests that this might
be because you've effectively allowed cost_hashjoin to give a cost
discount for inner unique, but provided no similar intelligence
in cost_mergejoin.

> I know we're close to the feature freeze, so I just want to say that
> I'll be AFK starting 5:30am Friday New Zealand time (13:30 on the 8th
> New York time), until Sunday ~4pm.

Understood.  I don't know if we'll get this in or not, but I'll work
on it.

			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 (131+ messages)  latest in thread

Message-ID: <16003.1460040386@sss.pgh.pa.us>
Permalink:  ../16003.1460040386@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16003.1460040386@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, tomas.vondra@2ndquadrant.com, simon@2ndquadrant.com
  Subject: Re: Performance improvement for joins where outer side is unique
  In-Reply-To: <16003.1460040386@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