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

Re: Index correlation versus multi-column indexes

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Maxim Boguk <mboguk(at)masterhost(dot)ru>
Subject: Re: Index correlation versus multi-column indexes
Date: 2009-02-27 23:01:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, 2009-02-27 at 13:25 -0500, Tom Lane wrote:
> So apparently we need to rethink this, and derate the correlation effect
> somehow when there are constraints on non-first columns.  I'm not
> entirely sure what the model ought to be.  Thoughts?

This seems similar to the problem of estimating correlation for a GiST
index (as I recall you mentioned before that we should be tracking
correlation per-index rather than per-attribute).

Unless we get significantly smarter about what "correlation" means, I
think its only purpose is for very simple range scans. And, as you point
out, a selective predicate on a non-first attribute means that it's not
really a range scan.

I don't see an easy solution to this other than just saying that a
predicate on a second attribute is not a range scan at all, unless the
predicate is not very selective.

	Jeff Davis

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2009-02-27 23:30:29
Subject: pgsql: Temporarily (I hope) disable flattening of IN/EXISTS sublinks
Previous:From: Jaime CasanovaDate: 2009-02-27 22:59:05
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1530)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group