From: Josh Berkus <josh@agliodbs.com>
To: Kevin Brown <kevin@sysexperts.com>
To: Postgres Performance <pgsql-performance@postgresql.org>
Subject: Re: Column correlation drifts, index ignored again
Date: Tue, 24 Feb 2004 08:59:32 -0800
Message-ID: <200402240859.32312.josh@agliodbs.com> (raw)
In-Reply-To: <20040224035601.GC3090@filer>
References: <BC5E98B7.2DCB2%siracusa@mindspring.com>
<200402221617.27658.josh@agliodbs.com>
<20040224035601.GC3090@filer>
Kevin,
> 1. set enable_seqscan = on
> 2. set random_page_cost = <some really high value to force seqscans>
> 3. EXPLAIN ANALYZE query
> 4. record the ratio of estimated to actual scan times.
> 5. set enable_seqscan = off
> 6. set random_page_cost = <rough estimate of what it should be>
> 7. EXPLAIN ANALYZE query
> 8. record the actual index scan time(s)
> 9. tweak random_page_cost
> 10. EXPLAIN query
> 11. If ratio of estimate to actual (recorded in step 8) is much
> different than that recorded in step 4, then go back to step 9.
> Reduce random_page_cost if the random ratio is larger than the
> sequential ratio, increase if it's smaller.
Nice, we ought to post that somewhere people can find it in the future.
I'm also glad that your new job allows you to continue doing PostgreSQL stuff.
--
Josh Berkus
Aglio Database Solutions
San Francisco
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: josh@agliodbs.com, kevin@sysexperts.com
Subject: Re: Column correlation drifts, index ignored again
In-Reply-To: <200402240859.32312.josh@agliodbs.com>
* 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