Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tiyqu-0004qE-5U for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Dec 2012 02:48:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tiyqs-0006wp-LM for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Dec 2012 02:48:46 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tiyqr-0006wj-GP for pgsql-hackers@postgreSQL.org; Thu, 13 Dec 2012 02:48:45 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tiyqo-0002wI-In for pgsql-hackers@postgreSQL.org; Thu, 13 Dec 2012 02:48:44 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1Tiyqj-0007P6-T5; Wed, 12 Dec 2012 21:48:37 -0500 Date: Wed, 12 Dec 2012 21:48:37 -0500 From: Bruce Momjian To: Andrew Dunstan Cc: Tom Lane , PostgreSQL-development Subject: Re: [PERFORM] encouraging index-only scans Message-ID: <20121213024837.GB22363@momjian.us> References: <50C8F1EC.9010801@dunslane.net> <15321.1355347953@sss.pgh.pa.us> <50C90154.8060103@dunslane.net> <50C904DB.9090305@dunslane.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50C904DB.9090305@dunslane.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Wed, Dec 12, 2012 at 05:27:39PM -0500, Andrew Dunstan wrote: > > 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? [ moved to hackers list.] Yes, this does seem like a problem for upgrades from 9.2 to 9.3? We can have pg_dump --binary-upgrade set these, or have ANALYZE set it. I would prefer the later. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers