I am curious about how the internal data structures and storage mechanism of the spatial GiST index in Postgis. In Oracle, I used to like to show how the SDO indexes were "just another table", and how the levels were attributes of the indexes, and the bboxes of the indexed geometries were stored as blobs (that could be extracted). HOw does postgis store the indexes, and where?
The system tables http://www.postgresql.org/docs/8.3/static/catalogs.html can be used to identify indexes, but I do not know how to access the actual storage ( if they are indeed tables)
-
I have found this: <sai.msu.su/~megera/postgres/gist/gevel/README.gevel>. Gevel should be able to visualize this, but I am unable to get this to run with postgis.app (mac osx) with PostGIS 2.0.MartinT– MartinT2016年02月12日 05:51:06 +00:00Commented Feb 12, 2016 at 5:51
-
1They're not "just another table" in PostgreSQL. They're index relations with a wholly different format.Craig Ringer– Craig Ringer2016年02月12日 06:46:04 +00:00Commented Feb 12, 2016 at 6:46
-
I think gevel is what there is. So, perhaps, you should rephrase your question with the issues you have having installing gevel. Interesting question, for sure.John Powell– John Powell2016年02月12日 12:07:05 +00:00Commented Feb 12, 2016 at 12:07
-
Thanks for the comments. Craig, I would upvote if you provided a response in the vain of what you have commented, but with more details or links to the relevant materials. I am interested in HOW this is stored. John, I will make a separate question re gavel. Still, a pointer to the documentation on how storage is achieved is what I am after.MartinT– MartinT2016年02月16日 03:16:47 +00:00Commented Feb 16, 2016 at 3:16
-
I have added a question about gevel here: gis.stackexchange.com/questions/180887/…MartinT– MartinT2016年02月16日 03:23:44 +00:00Commented Feb 16, 2016 at 3:23
1 Answer 1
As Craig mentions the spatial indexes are not just another table. Instead, PostGis uses GiST as the structural foundation for storing bbox details. Yes, this is (when using defaults) different and more efficient and less precise that B-Trees, or R-Trees....but you can specify parameters which make GiST indexes similar to spatial indexes from other storage.
Here is the documentation on how to work with them (including extending them.)
Dig in.