![Mastering PostgreSQL 9.6](https://wfqqreader-1252317822.image.myqcloud.com/cover/151/36701151/b_36701151.jpg)
上QQ阅读APP看书,第一时间看更新
Extending GiST
Of course, it is also possible to come up with your own operator classes. The following strategies are supported:
![](https://epubservercos.yuewen.com/69101E/19470408708964306/epubprivate/OEBPS/Images/16.jpg?sign=1739278429-7bknyNnE3kZKN02ZPIsCegUMM5EQxQ51-0-ecbc76a68ee495c3d3412c61fe88211c)
If you want to write operator classes for GiST, a couple of support functions have to be provided. In the case of a B-tree, there is only the same function - GiST indexes provide a lot more:
![](https://epubservercos.yuewen.com/69101E/19470408708964306/epubprivate/OEBPS/Images/17.jpg?sign=1739278429-4m7H4HLJ5HLQWHwPaab5x2ZwFCBRWuoE-0-c48875eba9333c87345f6a1941bbbc53)
Implementing operator classes for GiST indexes is usually done in C. If you are interested in a good example, I advise you to check out the btree_GiST module in the contrib directory. It shows how to index standard data types using GiST and is a good source of information as well as inspiration.