Re: Need theory/comprehension help on Multi-Column indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Need theory/comprehension help on Multi-Column indexes
Date: 2005-01-04 21:33:00
Message-ID: 20412.1104874380@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> I've been poking around the indexing code, and I really don't understand the
> page structure and splittng/branching for multi-column BTree indexes.

It's not fundamentally different from single-column indexes. The only
aspect of a btree index that requires any knowledge about the content of
index entries is the "compare two index entries for lesser, equal, or
greater" operation. For that, we just compare the first columns, then
compare the second columns if the first are equal, etc. Plain
lexicographic sort semantics.

Everything else in the btree code just considers an index entry to be an
undifferentiated tuple.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-01-04 21:44:27 Re: Need theory/comprehension help on Multi-Column indexes
Previous Message Karel Zak 2005-01-04 21:00:45 Re: Implementing RESET CONNECTION ...