Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiumU-0000oH-CX for pgsql-performance@arkaria.postgresql.org; Wed, 12 Dec 2012 22:27:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TiumT-0003DI-9r for pgsql-performance@arkaria.postgresql.org; Wed, 12 Dec 2012 22:27:57 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiumS-0003DD-Fa for pgsql-performance@postgresql.org; Wed, 12 Dec 2012 22:27:56 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiumQ-00040t-Jf for pgsql-performance@postgresql.org; Wed, 12 Dec 2012 22:27:55 +0000 X-Originating-IP: 217.70.178.130 Received: from mfilter1-d.gandi.net (mfilter1-d.gandi.net [217.70.178.130]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 067071720A9; Wed, 12 Dec 2012 23:27:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter1-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter1-d.gandi.net (mfilter1-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id zHSGdJo+DpdE; Wed, 12 Dec 2012 23:27:41 +0100 (CET) X-Originating-IP: 98.27.58.255 Received: from [192.168.10.146] (cpe-098-027-058-255.nc.res.rr.com [98.27.58.255]) (Authenticated sender: adsend@dunslane.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id DCE161720A3; Wed, 12 Dec 2012 23:27:40 +0100 (CET) Message-ID: <50C904DB.9090305@dunslane.net> Date: Wed, 12 Dec 2012 17:27:39 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-perform Subject: Re: encouraging index-only scans References: <50C8F1EC.9010801@dunslane.net> <15321.1355347953@sss.pgh.pa.us> <50C90154.8060103@dunslane.net> In-Reply-To: <50C90154.8060103@dunslane.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 12/12/2012 05:12 PM, Andrew Dunstan wrote: > > On 12/12/2012 04:32 PM, Tom Lane wrote: >> Andrew Dunstan writes: >>> A client is testing a migration from 9.1 to 9.2, and has found that a >>> large number of queries run much faster if they use index-only scans. >>> However, the only way he has found to get such a plan is by increasing >>> the seq_page_cost to insanely high levels (3.5). Is there any approved >>> way to encourage such scans that's a but less violent than this? >> Is the pg_class.relallvisible estimate for the table realistic? They >> might need a few more VACUUM and ANALYZE cycles to get it into the >> neighborhood of reality, if not. > > That was the problem - I didn't know this hadn't been done. > Actually, the table had been analysed but not vacuumed, so this kinda begs the question what will happen to this value on pg_upgrade? Will people's queries suddenly get slower until autovacuum kicks in on the table? cheers andrew -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance