From: Tom Lane <tgl@sss.pgh.pa.us>
To: simon@2ndquadrant.com
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org, Gabriele Bartolini <angusgb@tin.it>
Cc: Aaron Werman <awerman2@hotmail.com>
Subject: Re: Re: Re: Data warehousing requirements
Date: Fri, 08 Oct 2004 10:22:44 -0400
Message-ID: <12169.1097245364@sss.pgh.pa.us> (raw)
In-Reply-To: <28292295$10972388454166893d146f88.44056315@config5.schlund.de>
References: <28292295$10972388454166893d146f88.44056315@config5.schlund.de>
<simon@2ndquadrant.com> writes:
> Unfortunately, yes thats true - thats is for correctness, not an
> optimization decision. Outer joins constrain you on both join order AND
> on join type. Nested loops and hash joins avoid touching all rows in
> the right hand table, which is exactly what you don't want when you
> have a right outer join to perform, since you wish to include rows in
> that table when there is no match. Thus, we MUST choose a merge join
> even when (if it wasn't an outer join) we would have chosen a nested
> loops or hash.
The alternative of course is to flip it around to be a left outer join
so that we can use those plan types. But depending on the relative
sizes of the two tables this may be a loser.
If you are using a FULL join then it is indeed true that mergejoin is
the only supported plan type. I don't think that was at issue here
though.
regards, tom lane
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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com, josh@agliodbs.com, angusgb@tin.it, awerman2@hotmail.com
Subject: Re: Re: Re: Data warehousing requirements
In-Reply-To: <12169.1097245364@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