Re: Column correlation drifts, index ignored again

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Kevin Brown <kevin(at)sysexperts(dot)com>, Postgres Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Column correlation drifts, index ignored again
Date: 2004-02-24 16:59:32
Message-ID: 200402240859.32312.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Steve Atkins 2004-02-24 17:10:26 Re: Slow join using network address function
Previous Message Nick Barr 2004-02-24 16:44:57 Re: Slow join using network address function