Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A9FF59FB5AE for ; Wed, 6 Jun 2007 21:02:31 -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 08691-06 for ; Wed, 6 Jun 2007 21:02:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by postgresql.org (Postfix) with ESMTP id 30DA29FB5EC for ; Wed, 6 Jun 2007 21:02:28 -0300 (ADT) Received: from [192.168.1.11] (121-72-72-14.dsl.telstraclear.net [121.72.72.14]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0JJ800GF6O3DN420@smtp3.clear.net.nz> for pgsql-performance@postgresql.org; Thu, 07 Jun 2007 12:02:02 +1200 (NZST) Date: Thu, 07 Jun 2007 12:01:51 +1200 From: Mark Kirkwood Subject: Re: Weird 8.2.4 performance In-reply-to: <371D1936-E96B-4865-AEEF-C82AC41C2982@hotdogrecords.com> To: Kurt Overberg Cc: pgsql-performance@postgresql.org Message-id: <46674AEF.6040803@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <371D1936-E96B-4865-AEEF-C82AC41C2982@hotdogrecords.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070313) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/115 X-Sequence-Number: 25148 Kurt Overberg wrote: > Explain Outputs: > > -- 8.2 > > > -> Bitmap Heap Scan on taskinstance (cost=20.71..2143.26 rows=556 > width=8) (actual time=421.423..5655.745 rows=98 loops=9) > Recheck Cond: (taskinstance.taskid = task.id) > -> Bitmap Index Scan on taskid_taskinstance_key > (cost=0.00..20.57 rows=556 width=0) (actual time=54.709..54.709 rows=196 > loops=9) > -- 8.0 > > -> Index Scan using taskid_taskinstance_key on taskinstance > (cost=0.00..2152.28 rows=563 width=8) (actual time=0.012..0.832 rows=145 > loops=11) 8.2 is deciding to use a bitmap index scan on taskid_taskinstance_key, which seems to be slower (!) than a plain old index scan that 8.0 is using. A dirty work around is to disable bitmap scans via: SET enable_bitmapscan=off but it is probably worthwhile to try to find out *why* the bitmap scan is 1) slow and 2) chosen at all given 1). One thought that comes to mind - is work_mem smaller on your 8.2 system than the 8.0 one? (or in fact is it very small on both?). Also it might be interesting to see your non-default postgresql.conf settings for both systems. Cheers Mark