pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Further fixes for degenerate outer join clauses.
Date: Wed, 12 Aug 2015 22:35:55 -0400
Message-ID: <31854.1439433355@sss.pgh.pa.us> (raw)
In-Reply-To: <55CB9BEA.4030103@dunslane.net>
References: <E1ZNQxR-00072N-0D@gemulon.postgresql.org>
	<55CB9BEA.4030103@dunslane.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andrew Dunstan <andrew@dunslane.net> writes:
> On 08/06/2015 03:36 PM, Tom Lane wrote:
>> Further fixes for degenerate outer join clauses.

> Looks like this might have upset brolga on 9.0 and 9.1 - it's coming up 
> with a different plan from what's expected.

I looked into this, and while I can't be certain of the diagnosis without
looking at the assembly code brolga generates (no, I don't want to), I'm
pretty sure I know what's going on here.  The two plans in question have
exactly the same estimated costs on my machine, which results in add_path
discarding the second one to arrive.  Evidently, on brolga the second path
gets some fractionally cheaper estimate due to some compiler-specific
variation in the way the arithmetic is done, so it gets kept rather than
the first one.

In 9.2 and up we got rid of that class of problems with this patch:

    Author: Tom Lane <tgl@sss.pgh.pa.us>
    Branch: master Release: REL9_2_BR [33e99153e] 2012-04-21 00:51:14 -0400

    Use fuzzy not exact cost comparison for the final tie-breaker in add_path.
    
    Instead of an exact cost comparison, use a fuzzy comparison with 1e-10
    delta after all other path metrics have proved equal.  This is to avoid
    having platform-specific roundoff behaviors determine the choice when
    two paths are really the same to our cost estimators.  Adjust the
    recently-added test case that made it obvious we had a problem here.

but 9.0 and 9.1 still have platform-dependent treatment of paths with
essentially equal cost estimates.

I'm not entirely sure what to do about this.  We could back-patch that
patch into 9.0 and 9.1, but it's conceivable somebody would squawk about
planner behavioral changes.  The only other idea that seems practical is
to remove regression test cases that have platform-specific results in
those branches.  Probably that wouldn't result in a real reduction in the
quality of the test coverage for those branches (we could still execute
the query, just not EXPLAIN it).  But it seems like a pretty ad-hoc
answer, and the next case might be one that hurts more not to test.

Thoughts?

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

Message-ID: <31854.1439433355@sss.pgh.pa.us>
Permalink:  ../31854.1439433355@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31854.1439433355@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, andrew@dunslane.net, pgsql-hackers@postgreSQL.org
  Subject: Re: [COMMITTERS] pgsql: Further fixes for degenerate outer join clauses.
  In-Reply-To: <31854.1439433355@sss.pgh.pa.us>
  References: <E1ZNQxR-00072N-0D@gemulon.postgresql.org> <55CB9BEA.4030103@dunslane.net> <31854.1439433355@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