From: Tom Lane <tgl@redhat.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-perform <pgsql-performance@postgresql.org>
Subject: Re: encouraging index-only scans
Date: Wed, 12 Dec 2012 16:32:33 -0500
Message-ID: <15321.1355347953@sss.pgh.pa.us> (raw)
In-Reply-To: <50C8F1EC.9010801@dunslane.net>
References: <50C8F1EC.9010801@dunslane.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Andrew Dunstan <andrew@dunslane.net> 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.
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.
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@redhat.com, andrew@dunslane.net
Subject: Re: encouraging index-only scans
In-Reply-To: <15321.1355347953@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox