Re: Clustered indexes - When to use them?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: MaXX <bs139412(at)skynet(dot)be>, pgsql-general(at)postgresql(dot)org
Subject: Re: Clustered indexes - When to use them?
Date: 2005-11-02 23:29:44
Message-ID: 12033.1130974184@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> That's because unfortunately PostgreSQL only keeps statistics on
> individual columns. There's no stats kept on multi-column indexes; the
> best the planner can do is use the stats for the first column.

That's not what we do at all: we do look at the stats for each column
and combine them.

The deficiency is that we don't have any stats about cross-column
correlations, and therefore must assume that the columns are independent
(in the statistical sense). This is a poor assumption in the real world.
But it's a lot subtler than "we only consider the first column".

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-11-02 23:30:38 Re: Lock Modes (Documentation)
Previous Message Jim C. Nasby 2005-11-02 23:23:34 Re: Replicating databases