Re: Need theory/comprehension help on Multi-Column indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Need theory/comprehension help on Multi-Column indexes
Date
Msg-id 20412.1104874380@sss.pgh.pa.us
Whole thread Raw
In response to Need theory/comprehension help on Multi-Column indexes  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Need theory/comprehension help on Multi-Column indexes
List pgsql-hackers
Josh Berkus <josh@agliodbs.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


pgsql-hackers by date:

Previous
From: "Serguei A. Mokhov"
Date:
Subject: Re: Final call for translation updates
Next
From: Josh Berkus
Date:
Subject: Re: Need theory/comprehension help on Multi-Column indexes