Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T23DX-0003nV-AY for pgsql-bugs@postgresql.org; Thu, 16 Aug 2012 16:46:43 +0000 Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T23DU-0002mY-Cn for pgsql-bugs@postgresql.org; Thu, 16 Aug 2012 16:46:43 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 16 Aug 2012 11:46:38 -0500 Message-Id: <502CDD9602000025000497B7@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Thu, 16 Aug 2012 11:46:30 -0500 From: "Kevin Grittner" To: , Subject: Re: Re-2: BUG #7495: chosen wrong index References: <502B75150200002500049751@gw.wicourts.gov> <1345112066.AD21FD7F0.11678@debian2> In-Reply-To: <1345112066.AD21FD7F0.11678@debian2> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201208/132 X-Sequence-Number: 33856 wrote: > In my live environment i have a table with a boolean where the > boolean is usually true. The boolean is false on new or changed > entrys and if i select the false-rows order by primary key i get > slow querys. The table has a lot of million rows and a very small > amount of rows with false. That sure sounds like a situation where you should use a partial index. http://www.postgresql.org/docs/current/interactive/indexes-partial.html -Kevin