pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Greg Stark <gsstark@mit.edu>
To: Greg Stark <gsstark@MIT.EDU>
Cc: Jared Carr <jared@89glass.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: A question on the query planner
Date: 02 Dec 2003 17:43:34 -0500
Message-ID: <87k75e96y1.fsf@stark.dyndns.tv> (raw )
In-Reply-To: <87ptf697h0.fsf@stark.dyndns.tv >
References: <3FCBB639.10409@89glass.com >
<1070385381.24915.8650.camel@camel >
<3FCCD225.8030609@89glass.com >
<87d6b79har.fsf@stark.dyndns.tv >
<3FCCE48B.10406@89glass.com >
<871xrn9e09.fsf@stark.dyndns.tv >
<3FCCF61E.90307@89glass.com >
<87ptf697h0.fsf@stark.dyndns.tv >
Greg Stark <gsstark@MIT.EDU> writes:
> Huh. The following shows something strange.
Worse, with enable_hashjoin off it's even more obvious something's broken:
test=# set enable_hashjoin = off;
SET
test=# explain select * from a,b where a.x=b.x;
QUERY PLAN
------------------------------------------------------------------
Merge Join (cost=139.66..159.67 rows=1001 width=64)
Merge Cond: ("outer"."?column2?" = "inner"."?column2?")
-> Sort (cost=69.83..72.33 rows=1000 width=32)
Sort Key: (a.x)::text
-> Seq Scan on a (cost=0.00..20.00 rows=1000 width=32)
-> Sort (cost=69.83..72.33 rows=1000 width=32)
Sort Key: (b.x)::text
-> Seq Scan on b (cost=0.00..20.00 rows=1000 width=32)
(8 rows)
test=# explain select * from a2,b2 where a2.x=b2.x;
QUERY PLAN
-----------------------------------------------------------------------------
Merge Join (cost=0.00..63.04 rows=1001 width=64)
Merge Cond: ("outer".x = "inner".x)
-> Index Scan using a2_pkey on a2 (cost=0.00..24.00 rows=1000 width=32)
-> Index Scan using b2_pkey on b2 (cost=0.00..24.00 rows=1000 width=32)
(4 rows)
--
greg
view thread (19+ messages) latest in thread
Message-ID: <87k75e96y1.fsf@stark.dyndns.tv>
Permalink: ../87k75e96y1.fsf@stark.dyndns.tv/
Also on: postgresql.org/message-id/87k75e96y1.fsf@stark.dyndns.tv
copy link · copy postgr.es
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-performance@postgresql.org
Cc: gsstark@mit.edu, jared@89glass.com
Subject: Re: A question on the query planner
In-Reply-To: <87k75e96y1.fsf@stark.dyndns.tv>
* 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