Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 345C19FBA22 for ; Tue, 3 Apr 2007 18:21:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63519-01 for ; Tue, 3 Apr 2007 18:21:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 989BF9FB978 for ; Tue, 3 Apr 2007 18:21:07 -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 l33LL5or012661; Tue, 3 Apr 2007 17:21:05 -0400 (EDT) To: "Alex Deucher" cc: "Merlin Moncure" , "PostgreSQL Performance" Subject: Re: postgres 7.4 vs 8.x redux: query plans In-reply-to: References: <17931.1175578083@sss.pgh.pa.us> Comments: In-reply-to "Alex Deucher" message dated "Tue, 03 Apr 2007 16:34:19 -0400" Date: Tue, 03 Apr 2007 17:21:05 -0400 Message-ID: <12660.1175635265@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/38 X-Sequence-Number: 23915 "Alex Deucher" writes: > Turning off bitmapscan ends up doing a sequential scan. Turning off > both bitmapscan and seqscan results in a bitmap heap scan. It doesn't > seem to want to use the index at all. Any ideas? The "ORed indexscans" plan style that was in 7.4 isn't there anymore; we use bitmap OR'ing instead. There actually are repeated indexscans hidden under the "= ANY" indexscan condition in 8.2, it's just that the mechanism for detecting duplicate matches is different. AFAIK the index access costs ought to be about the same either way, and the other costs the same or better as what we did in 7.4. It's clear though that 8.2 is taking some kind of big hit in the index access in your case. There's something very strange going on here. You do have both lc_collate and lc_ctype set to C, right? What about database encoding? regards, tom lane