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 9347A11F681A for ; Thu, 6 Apr 2006 21:15:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92296-10 for ; Thu, 6 Apr 2006 21:15:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web52308.mail.yahoo.com (web52308.mail.yahoo.com [206.190.48.151]) by postgresql.org (Postfix) with SMTP id 29FA211F6610 for ; Thu, 6 Apr 2006 21:15:39 -0300 (ADT) Received: (qmail 89519 invoked by uid 60001); 7 Apr 2006 00:15:39 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=x9hroB2eAyg4p+lX6NiaRbgJpwNSid+diHzZuFJLtJbmtY5Qwhe5jFpWgOshn6ubjiZ/H/mGVTk+deiWRbIbyG6a07RLa6XgjkEL6MyJkYk/tdin6TbXPvCkS7gS5t8pUzgMktqMYNArXPh09Hig8OysgrgX1227H5kc6J+aKIQ= ; Message-ID: <20060407001538.89517.qmail@web52308.mail.yahoo.com> Received: from [202.156.6.68] by web52308.mail.yahoo.com via HTTP; Fri, 07 Apr 2006 10:15:38 EST Date: Fri, 7 Apr 2006 10:15:38 +1000 (EST) From: Brian Herlihy Subject: Re: Query planner is using wrong index. To: pgsql-performance@postgresql.org In-Reply-To: <00c101c659d7$8cc26a70$8300a8c0@tridecap.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200604/123 X-Sequence-Number: 18207 --- Dave Dutcher wrote: > > -----Original Message----- > > To: pgsql-performance@postgresql.org > > Subject: Re: [PERFORM] Query planner is using wrong index. > [Snip] > > I am really surprised that I have to go through such contortions just > to > > use > > the primary key! This area of Postgres needs improvement. > > > > > Of course you mentioned that you are using 7.4.7. You might want to try > upgrading to 8.1.3. There have been a lot of improvements to the > performance since 7.4. I don't know if your specific problem was fixed, > but it's worth a try. > > Also you might want to at least upgrade to 7.4.12 for the bug fixes. Thanks for the suggestions. I've verified the same problem in 8.1.3 as well, after my initial post. It was actually in 8.1.3 that I first discovered the problem. I noticed this item in the TODO list: - Allow accurate statistics to be collected on indexes with more than one column or expression indexes, perhaps using per-index statistics This is what I need! But until that is added, I need a way to use the primary key with the current version :) Thanks, Brian