Re: GiST index implementation - Mailing list pgsql-general

From Elena Camossi
Subject Re: GiST index implementation
Date
Msg-id 5dea05d0708030057g6fcc678fo9528b00b86c9b7f5@mail.gmail.com
Whole thread Raw
In response to Re: GiST index implementation  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: GiST index implementation  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
Hi Gregory,

thank you very much for you answer!

>
> what is the default implementation for GiST index? B-Tree or R-Tree?
> That is, if i execute the following SQL command:
>
>      CREATE index ON table USING Gist (column)
>
> what is the type of the index that is actually built?

uhm, GIST. GIST is a particular type of index just like btree.

according to the documentation (ch 11.2) "GiST indexes are not a single kind of index, but rather an infrastructure within wich many different indexing strategies can be implemented", and (ch 50.1) "B-Tree, R-Tree and many other indexing schemes can be implemented in GiST".
Moreover, according to what i found on the web (see http://www.sai.msu.su/~megera/postgres/gist/ ) some of such implementations are now included in the core of Postgres.
I supposed there was a way to specify one among the implementation provided. 

What are you actually trying to do? Do you have a particular problem you're
trying to solve?

I wanted to test the suitability and the efficiency of  R-Tree/GiST for query involving standard PostgreSQL temporal column data.

> How can I specify in SQL one of the two implementations provided (e.g.
> R-Tree)?

R-Tree indexes don't exist in Postgres any more. GIST indexes are very similar
only more general. They handle 2D geometric data types like RTree did
previously as well as n-dimensional data types and other more exotic things
like intarrays and full text search.

Are these  functionalities all included by default in the standard GiST indexing?

There are different "kinds" of GIST indexes which you can specify by
specifying an operator class with you define the index.
But most data types
only have a single operator class available to them so that's probably not
what you need unless you're trying to do something unusual.
An "operator class" defines a set of operators which can be optimized by an
index organized the same way and usually correspond to a particular
interpretation of the data type.

Is the specification of the operator class done when I create the index?
Or is the  suitable  operator class automatically loaded according to the data type of the column on which I build the index?
And if I would specify a different operator class, how can i do it?
May I provide a different operator class beyond the ones provided?

Thank you very much.

Regards,
-Elena


pgsql-general by date:

Previous
From: mljv@planwerk6.de
Date:
Subject: Re: pgpool2 vs sequoia
Next
From: "Chris Coleman"
Date:
Subject: Suse RPM's