pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Harry Hehl <Harry.Hehl@diskstream.com>
Cc: Mark Kirkwood <markir@paradise.net.nz>
Cc: pgsql-performance@postgresql.org
Subject: Re: Sequencial scan instead of using index
Date: Tue, 11 Apr 2006 18:49:59 -0400
Message-ID: <11754.1144795799@sss.pgh.pa.us> (raw)
In-Reply-To: <6AD4F3A63B017C4FB074E2C895AD18541090C6@EXCHSRV.waterloonetworking.net>
References: <6AD4F3A63B017C4FB074E2C895AD18541090C6@EXCHSRV.waterloonetworking.net>

"Harry Hehl" <Harry.Hehl@diskstream.com> writes:
>  Nested Loop IN Join  (cost=21432.32..951981.42 rows=204910 width=217)
>    Join Filter: ("outer".objectid = "inner".ref_oid)
>    ->  Append  (cost=0.00..8454.10 rows=204910 width=217)
>          ->  Seq Scan on omfile  (cost=0.00..8428.20 rows=204320
> width=217)
>          ->  Seq Scan on omimagefile omfile  (cost=0.00..12.70 rows=270
> width=217)
>          ->  Seq Scan on omclipfile omfile  (cost=0.00..13.20 rows=320
> width=217)
>    ->  Materialize  (cost=21432.32..21434.32 rows=200 width=16)
>          ->  Unique  (cost=20614.91..21430.12 rows=200 width=16)
>                ->  Sort  (cost=20614.91..21022.52 rows=163041 width=16)
>                      Sort Key: ts.ref_oid
>                      ->  Seq Scan on ts  (cost=0.00..3739.41 rows=163041
> width=16)

> (11 rows) 
> Time: 164.232 ms 

> So how can I get index scans to work consistently with joins?

It's not the join that's the problem, it's the inheritance.  I recently
improved the planner so that it can consider appended indexscans for an
inheritance tree on the inside of a join, but no pre-8.2 release can do
it.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <11754.1144795799@sss.pgh.pa.us>
Permalink:  ../11754.1144795799@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11754.1144795799@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, Harry.Hehl@diskstream.com, markir@paradise.net.nz
  Subject: Re: Sequencial scan instead of using index
  In-Reply-To: <11754.1144795799@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