From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heni Lolov <hal_bg@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Indexes and outer join?
Date: Mon, 04 Mar 2002 10:13:30 -0500
Message-ID: <3915.1015254810@sss.pgh.pa.us> (raw)
In-Reply-To: <20020304111104.2621.qmail@web21005.mail.yahoo.com>
References: <20020304111104.2621.qmail@web21005.mail.yahoo.com>
Heni Lolov <hal_bg@yahoo.com> writes:
> explain select *
> from tyc_glup
> where de>0 and de<1000000 and ra<100000 and ra>0;
> NOTICE: QUERY PLAN:
> Merge Join (cost=42975.66..44050.21 rows=34159 width=50)
> -> Sort (cost=108.53..108.53 rows=26 width=14)
> -> Index Scan using tycho_drm on tycho (cost=0.00..107.90 rows=26
> width=14)
> -> Sort (cost=42867.14..42867.14 rows=258997 width=36)
> -> Seq Scan on sao (cost=0.00..4609.97 rows=258997 width=36)
Hmm. This plan doesn't make a lot of sense to me; with so few rows
coming out of tycho, I'd have expected the thing to pick a nestloop.
Do you have enable_nestloop turned off? What plan do you get for this
query if you set enable_mergejoin to off?
Also, what PG version is this?
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 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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, hal_bg@yahoo.com
Subject: Re: Indexes and outer join?
In-Reply-To: <3915.1015254810@sss.pgh.pa.us>
References: <20020304111104.2621.qmail@web21005.mail.yahoo.com> <3915.1015254810@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