[postgis-users] implement your own index

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue May 18 04:17:55 PDT 2010

Biddy wrote:

> María, thank you for the fast reply. However, these docs refer to the 
> usage of GIST.
> If I understand it correctly, an R-tree is implemented on top of GIST.
> What if I don't want to use an R-tree? If I wanted to implement my own 
> ...let's say I want to implement a quadtree or some other new, fancy 
> index. How would I go about doing it?

The GIST API currently does not support space partition-based nor 
ordered indices (see 
for the exact details). So if you wanted to implement a quadtree or 
nearest neighbour type index searches then you'd need to alter the GIST 
API or invent another index AM in PostgreSQL first.

You may find the SP-GIST project interesting in this respect: 

> Additionally, is there a way to change the attributes with which the 
> R-tree is built? Or at least see how the R-tree is built?

It depends what attributes you are trying to modify. If they can be 
defined in terms of the GIST picksplit function then it is likely possible.

In terms of visualising the R-Tree itself, Oleg and Teodor's gevel 
module from http://www.sai.msu.su/~megera/postgres/gist/ can be used as 
an aid to generate output suitable for rendering.



Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs

More information about the postgis-users mailing list