Re: Indexes and outer join?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heni Lolov <hal_bg(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Indexes and outer join?
Date: 2002-03-04 15:13:30
Message-ID: 3915.1015254810@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Heni Lolov <hal_bg(at)yahoo(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Lucas Rockwell 2002-03-04 15:28:09 something similar to explain
Previous Message Janning Vygen 2002-03-04 13:49:35 Re: thinking about versioning my database schema