Mastering PostgreSQL 9.6
上QQ阅读APP看书,第一时间看更新

Extending GiST

Of course, it is also possible to come up with your own operator classes. The following strategies are supported:

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:

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.