Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 4B01B9FB93F for ; Tue, 3 Apr 2007 18:43:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 78900-04 for ; Tue, 3 Apr 2007 18:43:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by postgresql.org (Postfix) with ESMTP id 16DD59FB8F0 for ; Tue, 3 Apr 2007 18:43:48 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c24so1863003ana for ; Tue, 03 Apr 2007 14:43:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ttqnvw7+GTR79ZuafRr8HrZlwtAAkQqEnW1HBn9te5UMRRs3EHUv06XCZLXHFQRZDkrbsjEGNTCbE7KnY1NGE4O4BXe3mYDoSwnlYMNy3e+hNWmTFA5PvD3bRBg15JDLDhC1o10ioBUAEyVDlnD+O7fH/dj81vjyF5TNseLqDNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=O0j0ohFnfAasUTpgJ1nz0OlyiLHMG1sg+3aT4M/0LFcMAnAg/ID6jWCkpW2IXUCKO2kiaEYCPhi8B5m0Trs5X6kR7CVfXN/70N3ukj58HdUjNbQ6baglX8z3zxVjAV2/jbwGhpG1Dqw+xTIG5cq4zrAzzbBLe3OQ7b6NzJVSfhc= Received: by 10.100.174.16 with SMTP id w16mr4846127ane.1175636627471; Tue, 03 Apr 2007 14:43:47 -0700 (PDT) Received: by 10.100.247.7 with HTTP; Tue, 3 Apr 2007 14:43:47 -0700 (PDT) Message-ID: Date: Tue, 3 Apr 2007 17:43:47 -0400 From: "Alex Deucher" To: "Tom Lane" Subject: Re: postgres 7.4 vs 8.x redux: query plans Cc: "Merlin Moncure" , "PostgreSQL Performance" In-Reply-To: <12660.1175635265@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17931.1175578083@sss.pgh.pa.us> <12660.1175635265@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/41 X-Sequence-Number: 23918 On 4/3/07, Tom Lane wrote: > "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? > Also for reference, the old 7.4 DB is C for lc_collate and lc_ctype and SQL_ASCII for encoding. Alex