Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Tue, 24 Feb 2004 08:59:32 -0800
  • Message-id: <200402240859.32312.josh@agliodbs.com> <text/plain>

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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group