7

I want to know if PostGIS has a separate implementation of GIST index or it reuses the GIST index implementation provided by Postgresql?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jun 30, 2014 at 5:59

2 Answers 2

8

There's two things going on here: the GIST API in PostgreSQL and the bindings of types to that API for the purposes of building an R-Tree.

PostGIS necessarily uses the PostgreSQL GIST API. That's what it's for. That way we don't have to worry about transaction management or writing things to disk or all the other messy important things involved in maintaining your own index.

PostGIS has its own code to use the GIST API. There is code for building r-trees-on-gist in the PostgreSQL code base, but PostGIS does not use that code, we have our own, which is very similar (it's still aiming for an r-tree structure), but not identical.

answered Jun 30, 2014 at 16:33
0
2

In the PostGIS documentation it says:

PostgreSQL supports three kinds of indexes by default: B-Tree indexes, R-Tree indexes, and GiST indexes.

...

GiST (Generalized Search Trees) indexes break up data into "things to one side", "things which overlap", "things which are inside" and can be used on a wide range of data-types, including GIS data. PostGIS uses an R-Tree index implemented on top of GiST to index GIS data.

To me this says that PostGIS re-uses the GiST index implementation provided by PostgreSQL.

answered Jun 30, 2014 at 6:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.