![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=1738862820-axHy3wa66J9MnOTl7QFDOep9OvpDjMNn-0-563e4759eae8c55700f8483c0dfcbc17)
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=1738862820-Xujsx0yUrzluaFuD5LfOJbxs0OQ6akCd-0-894694672a5810365ac7070d9bc7f511)
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.