Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E74ED1337B80 for ; Wed, 13 Apr 2011 04:56:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 19442-05 for ; Wed, 13 Apr 2011 07:55:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vidle.i.cz (vidle.i.cz [78.31.27.2]) by mail.postgresql.org (Postfix) with ESMTP id 0D74C13364DE for ; Wed, 13 Apr 2011 04:55:42 -0300 (ADT) Received: from ns1.i.cz (ns1.i.cz [192.168.24.101]) by vidle.i.cz (Postfix) with ESMTPS id 0506FAD01E for ; Wed, 13 Apr 2011 09:55:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ns1.i.cz (Postfix) with ESMTP id 288A0FE85 for ; Wed, 13 Apr 2011 09:55:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ns1.i.cz Received: from ns1.i.cz ([127.0.0.1]) by localhost (ns1.i.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h1qQ+cetf0Fn for ; Wed, 13 Apr 2011 09:55:40 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by Authenticated User (ns1.i.cz) with ESMTPSA id 10448FE84 Received: from zito by bobek.localdomain with local (Exim 4.75) (envelope-from ) id 1Q9uvJ-0006Pd-41 for pgsql-performance@postgresql.org; Wed, 13 Apr 2011 09:55:37 +0200 Date: Wed, 13 Apr 2011 09:55:37 +0200 From: =?iso-8859-1?Q?V=E1clav_Ovs=EDk?= To: pgsql-performance@postgresql.org Subject: Re: poor execution plan because column dependence Message-ID: <20110413075537.GA24050@bobek.localdomain> References: <20110412232343.GA15966@bobek.localdomain> <867169.80414.qm@web39703.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <867169.80414.qm@web39703.mail.mud.yahoo.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/181 X-Sequence-Number: 43243 Dear Bob, On Tue, Apr 12, 2011 at 05:14:29PM -0700, Bob Lunney wrote: > Zito, > > Using psql log in as the database owner and run "analyze verbose". Happiness will ensue. Unfortunately not. I ran "analyze" with different values default_statistics_target till 1000 as first tries always with the same problem described. I returned the value to the default 100 at the end: > Also, when requesting help with a query its important to state the > database version ("select version();") and what, if any, configuration > changes you have made in postgresql.conf. Listing ony the ones that > have changed is sufficient. You are right. I red about this, but after reading, analyzing, experimenting finally forgot to mention this basic information :(. The reason was I didn't feel to be interesting now also probably. The problem is planner I am afraid. Application and PostgreSQL is running on KVM virtual machine hosting Debian GNU/Linux Squeeze. "select version();" returns: 'PostgreSQL 8.4.7 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit' Changed interesting parameters in postgresql.conf: max_connections = 48 shared_buffers = 1024MB work_mem = 32MB maintenance_work_mem = 256MB checkpoint_segments = 24 effective_cache_size = 2048MB log_min_duration_statement = 500 The virtual machine is the only one currently running on iron Dell PowerEdge R710, 2 x CPU Xeon L5520 @ 2.27GHz (quad-core), 32GiB RAM. PostgreSQL package installed is 8.4.7-0squeeze2. The VM has allocated 6GiB RAM and 2 CPU. One of my first hope was maybe a newer PostgreSQL series 9, can behaves better. I installed a second virtual machine with Debian GNU/Linux Sid and PostgreSQL package version 9.0.3-1. The result was the same. > Finally, the wiki has some good information on the care and feeding of a PostgreSQL database: > > http://wiki.postgresql.org/wiki/Introduction_to_VACUUM,_ANALYZE,_EXPLAIN,_and_COUNT I red this already. Thanks -- Zito