- Mastering PostgreSQL 12
- Hans Jürgen Sch?nig
- 183字
- 2021-08-20 10:00:28
Creating operator classes
Finally, all the components are in place, and it is possible to create the operator class that's needed by the index:
CREATE OPERATOR CLASS sva_special_ops
FOR TYPE text USING btree
AS
OPERATOR 1 <# ,
OPERATOR 2 <=# ,
OPERATOR 3 = ,
OPERATOR 4 >=# ,
OPERATOR 5 ># ,
FUNCTION 1 si_same(text, text);
The CREATE OPERATOR CLASS command connects strategies and operators to OPERATOR 1. <# means that strategy 1 will use the <# operator. Finally, the the _same function is connected with the operator class.
Note that the operator class has a name, and that it has been explicitly defined to work with B-trees. The operator class can already be used during index creation:
CREATE INDEX idx_special ON t_sva (sva sva_special_ops);
Creating an index works in a slightly different way than before: sva sva_special_ops means that the sva column is indexed using the sva_special_ops operator class. If sva_special_ops is not explicitly used, then PostgreSQL will not go for our special sort order, and will instead decide on the default operator class.
- Mastercam 2017數(shù)控加工自動編程經(jīng)典實例(第4版)
- OpenStack for Architects
- 計算機控制技術(shù)
- VMware Performance and Capacity Management(Second Edition)
- Maya 2012從入門到精通
- Docker Quick Start Guide
- Learning Apache Apex
- Cloudera Hadoop大數(shù)據(jù)平臺實戰(zhàn)指南
- ARM體系結(jié)構(gòu)與編程
- Building Smart Drones with ESP8266 and Arduino
- 從虛擬化到云計算
- Advanced Serverless Architectures with Microsoft Azure
- 筆記本電腦維修實用教程
- 玩中學(xué):樂高機器人入門(上冊) (中小學(xué)創(chuàng)客教育執(zhí)委會推薦教材)
- 嵌入式硬件技術(shù)基礎(chǔ)