上QQ阅读APP看书,第一时间看更新
Understanding how GiST works
To many people, GiST is still a black box. Therefore, I have decided to add a section to this section outlining how GiST works internally.
Consider the following diagram:
Figure 3.1: Source: http://leopard.in.ua/assets/images/postgresql/pg_indexes/pg_indexes2.jpg
Take a look at the tree. You will see that R1 and R2 are on top. R1 and R2 are the bounding boxes containing everything else. R3, R4, and R5 are contained by R1. R8, R9, and R10 are contained by R3 and so on. A GiST index is therefore hierarchically organized. What you can see in the diagram is that some operations, which are not available in B-trees are supported. Some of those operations are overlaps, left of, right of, and so on. The layout of a GiST tree is ideal for geometric indexing.