![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=1738889339-TpMLeXpnXxn9dFziTMTkL9xRldVOWeLO-0-0c4a5990d8031aa5a2e82d8e79eeabb4)
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=1738889339-ngJVHZMpuu95q5uuLMgnNCs8dayRuDmC-0-21afe4fee371e4c9de65e6385568f26f)
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.