Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiuXv-0000ar-4J for pgsql-performance@arkaria.postgresql.org; Wed, 12 Dec 2012 22:12:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TiuXu-0000lL-Ij for pgsql-performance@arkaria.postgresql.org; Wed, 12 Dec 2012 22:12:54 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiuXt-0000kV-3Z for pgsql-performance@postgresql.org; Wed, 12 Dec 2012 22:12:53 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiuXr-0006jD-0z for pgsql-performance@postgresql.org; Wed, 12 Dec 2012 22:12:52 +0000 X-Originating-IP: 217.70.178.141 Received: from mfilter13-d.gandi.net (mfilter13-d.gandi.net [217.70.178.141]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 0B81F1720A7; Wed, 12 Dec 2012 23:12:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter13-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter13-d.gandi.net (mfilter13-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id IHWjg7Xui048; Wed, 12 Dec 2012 23:12:38 +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 375CE17209A; Wed, 12 Dec 2012 23:12:38 +0100 (CET) Message-ID: <50C90154.8060103@dunslane.net> Date: Wed, 12 Dec 2012 17:12:36 -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> In-Reply-To: <15321.1355347953@sss.pgh.pa.us> 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 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. > > Keep in mind also that small values of random_page_cost necessarily > decrease the apparent advantage of index-only scans. If you think 3.5 > is an "insanely high" setting, I wonder whether you haven't driven those > numbers too far in the other direction to compensate for something else. Right. Thanks for the help. 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