Re: Composite Index Structure

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Nick Raj <nickrajjain(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Composite Index Structure
Date: 2011-03-07 09:31:22
Message-ID: 4D74A5EA.7090204@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07.03.2011 11:11, Nick Raj wrote:
> create index ..... using gist (coordinates,time). It will create index on
> both but i think there would be no linkage between them.
> But i want linkage between location and time tree. I want for each location
> i have Btree like
>
> Rtree root
> / \
> non-leaf .......
> / \ \
> leaf ...... leaf
> | |
> Btree root Btree root
> / \ / \
> non-leaf
> /
> leaf
>
> How to create this kind of structure?

A multi-column index is quite similar to that, you should get the same
performance characteristics. The leading column will determine the
primary order of the tree, and for rows that have the same value in the
leading column, the second column will determine the order among them.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2011-03-07 09:47:20 Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication.
Previous Message Simon Riggs 2011-03-07 09:30:35 Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication.