From: Aleksandr Vinokurov <aleksandr.vin@gmail.com>
To: Gregory Stark <stark@enterprisedb.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Incomprehensible dogged sort in Merge Join
Date: Fri, 31 Aug 2007 18:56:17 +0400
Message-ID: <46D82C11.5090506@gmail.com> (raw)
In-Reply-To: <877inb225q.fsf@oxford.xeocode.com>
References: <46D82318.3070700@gmail.com>
<877inb225q.fsf@oxford.xeocode.com>
Gregory Stark wrote:
> "Aleksandr Vinokurov" <aleksandr.vin@gmail.com> writes:
>
>> And that is its plan (attached one is the same, but with costs):
>>
>>> ---------------------------------<cut>--------------------------------<
>> Merge Left Join
>> Merge Cond: ("outer".name = "inner".name)
>> -> Sort
>> Sort Key: log.name
>> -> Seq Scan on log_example_3 log
>> -> Sort
>> Sort Key: uh.name
>> -> Subquery Scan uh
>> -> Sort
>> Sort Key: name
>> -> Seq Scan on user_history
>>> ---------------------------------<cut>--------------------------------<
>
> What version are you running with?
8.0.1, sorry for missing.
>
> Incidentally with CVS HEAD I see it working:
>
> postgres=# explain select * from (select * from a order by i) as a right join b on a.i = b.i ;
> QUERY PLAN
> -----------------------------------------------------------------
> Merge Right Join (cost=299.56..675.13 rows=22898 width=16)
> Merge Cond: (public.a.i = b.i)
> -> Sort (cost=149.78..155.13 rows=2140 width=8)
> Sort Key: public.a.i
> -> Seq Scan on a (cost=0.00..31.40 rows=2140 width=8)
> -> Sort (cost=149.78..155.13 rows=2140 width=8)
> Sort Key: b.i
> -> Seq Scan on b (cost=0.00..31.40 rows=2140 width=8)
> (8 rows)
>
>
>
>> With best regards to all of you,
>> Aleksandr.
>> ÿþ
>
> gesundheit.
>
>
Best wishes,
Aleksandr.
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-sql@postgresql.org
Cc: aleksandr.vin@gmail.com, stark@enterprisedb.com
Subject: Re: Incomprehensible dogged sort in Merge Join
In-Reply-To: <46D82C11.5090506@gmail.com>
* 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