X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7780B11F6247 for ; Tue, 11 Apr 2006 19:50:07 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.125 X-Spam-Level: X-Spam-Status: No, score=0.125 required=5 tests=[AWL=0.125] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 2Vh1U-ghBMTz for ; Tue, 11 Apr 2006 19:49:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 54E0111F61DE for ; Tue, 11 Apr 2006 19:50:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3BMnxGo011755; Tue, 11 Apr 2006 18:49:59 -0400 (EDT) To: "Harry Hehl" cc: "Mark Kirkwood" , pgsql-performance@postgresql.org Subject: Re: Sequencial scan instead of using index In-reply-to: <6AD4F3A63B017C4FB074E2C895AD18541090C6@EXCHSRV.waterloonetworking.net> References: <6AD4F3A63B017C4FB074E2C895AD18541090C6@EXCHSRV.waterloonetworking.net> Comments: In-reply-to "Harry Hehl" message dated "Tue, 11 Apr 2006 17:56:38 -0400" Date: Tue, 11 Apr 2006 18:49:59 -0400 Message-ID: <11754.1144795799@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200604/250 X-Sequence-Number: 18334 "Harry Hehl" 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