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 B16339DC833 for ; Wed, 18 Jan 2006 00:07:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22946-05 for ; Wed, 18 Jan 2006 00:07:08 -0400 (AST) 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 5EE399DC883 for ; Wed, 18 Jan 2006 00:07:07 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0I475M3004297; Tue, 17 Jan 2006 23:07:05 -0500 (EST) To: Hari Warrier cc: pgsql-performance@postgresql.org Subject: Re: Getting pg to use index on an inherited table (8.1.1) In-reply-to: <43CDB628.3030007@gmail.com> References: <43CDB628.3030007@gmail.com> Comments: In-reply-to Hari Warrier message dated "Tue, 17 Jan 2006 19:29:44 -0800" Date: Tue, 17 Jan 2006 23:07:05 -0500 Message-ID: <4296.1137557225@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.091 required=5 tests=[AWL=0.091] X-Spam-Score: 0.091 X-Spam-Level: X-Archive-Number: 200601/284 X-Sequence-Number: 16762 Hari Warrier writes: > A query on foobar2 (child table) uses the index, whereas the same query > via foobar (parent) doesn't. A query just on foobar should be able to use the index AFAIR. The problem here is that you have a join, and we are not very good about situations involving joins against inheritance sets (nor joins against UNION ALL subqueries, which is really about the same thing). I'm hoping to get a chance to look into improving this during the 8.2 development cycle. regards, tom lane