pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sean Chittenden <sean@chittenden.org>
Cc: Manfred Koizar <mkoi-pg@aon.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: Moving postgresql.conf tunables into 2003...
Date: Thu, 07 Aug 2003 19:31:52 -0400
Message-ID: <9730.1060299112@sss.pgh.pa.us> (raw)
In-Reply-To: <20030807202426.GI94710@perrin.int.nxad.com>
References: <20030703190502.GR72567@perrin.int.nxad.com>
	<2422.1057264735@sss.pgh.pa.us>
	<20030704000646.GV72567@perrin.int.nxad.com>
	<4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com>
	<20030805222609.GF94710@perrin.int.nxad.com>
	<rvm4jv82cseoqpn6jl3gib5u36aoi37tp3@4ax.com>
	<20030807202426.GI94710@perrin.int.nxad.com>

Sean Chittenden <sean@chittenden.org> writes:
>> If you CLUSTER on an index and then ANALYSE, you get a correlation of
>> 1.0 (== optimum) for the first column of the index.

> Correlating of what to what?  Of data to nearby data?  Of data to
> related data (ie, multi-column index?)? Of related data to pages on
> disk?  Not 100% sure in what context you're using the word
> correlation...

The correlation is between index order and heap order --- that is, are
the tuples in the table physically in the same order as the index?
The better the correlation, the fewer heap-page reads it will take to do
an index scan.

Note it is possible to measure correlation without regard to whether
there actually is any index; ANALYZE is simply looking to see whether
the values appear in increasing order according to the datatype's
default sort operator.

One problem we have is extrapolating from the single-column correlation
stats computed by ANALYZE to appropriate info for multi-column indexes.
It might be that the only reasonable fix for this is for ANALYZE to
compute multi-column stats too when multi-column indexes are present.
People are used to the assumption that you don't need to re-ANALYZE
after creating a new index, but maybe we'll have to give that up.

> But that value will degrade after time and at what rate?  Does ANALYZE
> maintain that value so that it's kept acurrate?

You keep it up to date by ANALYZE-ing at suitable intervals.  It's no
different from any other statistic.

			regards, tom lane



view thread (45+ messages)

Message-ID: <9730.1060299112@sss.pgh.pa.us>
Permalink:  ../9730.1060299112@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9730.1060299112@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sean@chittenden.org, mkoi-pg@aon.at
  Subject: Re: Moving postgresql.conf tunables into 2003...
  In-Reply-To: <9730.1060299112@sss.pgh.pa.us>
  References: <20030703190502.GR72567@perrin.int.nxad.com> <2422.1057264735@sss.pgh.pa.us> <20030704000646.GV72567@perrin.int.nxad.com> <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> <20030805222609.GF94710@perrin.int.nxad.com> <rvm4jv82cseoqpn6jl3gib5u36aoi37tp3@4ax.com> <20030807202426.GI94710@perrin.int.nxad.com> <9730.1060299112@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