Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 638CB2E2EFA for ; Mon, 28 Jan 2008 11:40:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 33983-09 for ; Mon, 28 Jan 2008 11:39:56 -0400 (AST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.179]) by postgresql.org (Postfix) with ESMTP id 3DCAB2E025F for ; Mon, 28 Jan 2008 11:39:56 -0400 (AST) Received: by wa-out-1112.google.com with SMTP id m38so3314467waf.5 for ; Mon, 28 Jan 2008 07:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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; bh=8uNxqqMmaJ21X0BOl9mlz8BC2J8EHOY5x8RWA4JpnS0=; b=bCvCakJ3YYJKfApJHDk1ip/Ox/J0raySbiKk/cVOEATqFxAttwh10mWQcQM01ETdL95MDaNBP/s/0K65J21BP1Sb2hx+fnbBzN/+zSsHpH3gojj3D9PoaPYfzgyJG2HvLVOcXRqObTS/TIPTfAEyNAiWT0j5VE1Kl09NfyM5UIQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fDnqXRS09VpkaCgpOAc3eDNg2xeTQmQ7+wOZFhNvToqoGtgtbrfqYLUk8VstxKJkgVrVtThwYFdIOtFM+vYhbysuZ3QR6DIlV50O21nK+UR2G1DG8rilE0pQpVfWUOb1xAc7/cPaJkGv2ShZbRJb8D68y62nkmJI/FtcwmEOmNk= Received: by 10.114.27.20 with SMTP id a20mr2421563waa.101.1201534794712; Mon, 28 Jan 2008 07:39:54 -0800 (PST) Received: by 10.114.133.5 with HTTP; Mon, 28 Jan 2008 07:39:54 -0800 (PST) Message-ID: Date: Mon, 28 Jan 2008 09:39:54 -0600 From: "Scott Marlowe" To: mlunnon@rwa-net.co.uk Subject: Re: Performance issues migrating from 743 to 826 Cc: pgsql-performance@postgresql.org In-Reply-To: <479DF476.4030800@rwa-net.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <479DBF75.6080402@rwa-net.co.uk> <479DF476.4030800@rwa-net.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/270 X-Sequence-Number: 28509 Whatever email agent you're using seems to be quoting in a way that doesn't get along well with gmail, so I'm just gonna chop most of it rather than have it quoted confusingly... Heck, I woulda chopped a lot anyway to keep it small. :) On Jan 28, 2008 9:27 AM, Matthew Lunnon wrote: > > Scott Marlowe wrote: > On Jan 28, 2008 5:41 AM, Matthew Lunnon wrote: > default_statistics_target = 1000 > > That's very high for the default. Planning times will be increased > > noticeably > > I had originally left the default_statistics_target at its default and then > increased it to 100, but this did not seem to make much difference. I will > reduce this down to something more normal again. You do know that if you create a column when the default is 10, then increase the default, it won't change the column's stats target, right? So, assuming the table was first created, then you changed the default, you'll now need to do: alter table xyz alter column abc set statistics 100; analyze xyz; for it to make any difference. > The queries were on exactly the same data. My interpretation of what is > going on here is that 8.2.6 seems to be leaving the filtering of market_id > to the very last point, which is why it ends up with 189 rows at this point > instead of the 2 that 743 has. 743 seems to do that filtering much earlier > and so reduce the number of rows at a much earlier point in the execution of > the query. I guess that this is something to do with the planner which is > why I tried increasing the default_statistics_target. Ahh, I'm guessing it's something that your 7.4 database CAN use an index on and your 8.2 data base can't use an index on. Like text in a non-C locale. Or something... Table def?