X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id EEC5B9FA13E for ; Tue, 13 Jun 2006 18:54:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 35127-02 for ; Tue, 13 Jun 2006 18:54:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id BE6F89F9316 for ; Tue, 13 Jun 2006 18:54:21 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 0396F5643D; Tue, 13 Jun 2006 16:54:20 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 13 Jun 2006 16:54:19 -0500 Date: Tue, 13 Jun 2006 16:54:19 -0500 From: "Jim C. Nasby" To: Shaun Thomas Cc: pgsql-performance@postgresql.org, Tom Lane Subject: Re: Confirmation of bad query plan generated by 7.4 Message-ID: <20060613215418.GI34196@pervasive.com> References: <9119.1150222168@sss.pgh.pa.us> <448EDFC4.8F27.00A9.0@leapfrogonline.com> <20060613211347.GB34196@pervasive.com> <448EE95D.8F27.00A9.0@leapfrogonline.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <448EE95D.8F27.00A9.0@leapfrogonline.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060613:sthomas@leapfrogonline.com::P2HD1ldIRYtCzeIW:00000000000 0000000000000000000000000azQ X-Hashcash: 1:20:060613:pgsql-performance@postgresql.org::3mbz7lXq5B2WiIAN:00000 0000000000000000000000005vU3 X-Hashcash: 1:20:060613:tgl@sss.pgh.pa.us::40mLcxzndPblpqW7:00000000000000000000 0000000000000000000000000a+2 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/212 X-Sequence-Number: 19569 On Tue, Jun 13, 2006 at 04:35:41PM -0500, Shaun Thomas wrote: > >>> On 6/13/2006 at 4:13 PM, "Jim C. Nasby" > wrote: > > > > Is there some compelling reason to stick with 7.4? In my experience > > you'll see around double (+100%) the performance going to 8.1... > > Not really. We *really* want to upgrade, but we're in the middle of > buying the new machine right now. There's also the issue of migrating > 37GB of data which I don't look forward to, considering we'll need to > set up a slony replication for the entire thing to avoid the hours > of downtime necessary for a full dump/restore. As long as the master isn't very heavily loaded it shouldn't be that big a deal to do so... > > What's your stats target set to for that table? > > Not sure what you mean by that. It's just that this table has 27M > rows > extending over 4 years, and I'm not quite sure how to hint to that. > An index scan for a few days would be a tiny fraction of the entire > table, so PG being insistent on the sequence scans was confusing the > hell > out of me. What's the output of SELECT attname, attstattarget FROM pg_attribute WHERE attrelid='table_name'::regclass AND attnum >= 0; and SHOW default_statistics_target; ? -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461