From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Jared Carr <jared@89glass.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: A question on the query planner
Date: 02 Dec 2003 20:33:15 -0500
Message-ID: <87znea7kis.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <25476.1070409047@sss.pgh.pa.us>
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>
<25476.1070409047@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Define "no longer works well". varchar doesn't have its own comparison
> operators anymore, but AFAIK that makes no difference.
Well it seems to completely bar the use of a straight merge join between two
index scans:
test=# set enable_seqscan = off;
SET
test=# explain select * from a,b where a.x=b.x;
QUERY PLAN
---------------------------------------------------------------------------
Nested Loop (cost=100000000.00..100002188.86 rows=1001 width=64)
-> Seq Scan on a (cost=100000000.00..100000020.00 rows=1000 width=32)
-> Index Scan using b_pkey on b (cost=0.00..2.16 rows=1 width=32)
Index Cond: (("outer".x)::text = (b.x)::text)
(4 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
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, tgl@sss.pgh.pa.us, jared@89glass.com
Subject: Re: A question on the query planner
In-Reply-To: <87znea7kis.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