- Mastering PostgreSQL 9.6
- Hans Jurgen Schonig
- 162字
- 2021-07-09 19:57:20
Creating operator classes
Finally, all components are in place and it is finally possible to create the operator class 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. OPERATOR 1 <# means that strategy 1 will use the <# operator. Finally 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 the index works in a slightly different way than previously: 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 but decide on the default operator class.
- 計(jì)算機(jī)圖形學(xué)
- 協(xié)作機(jī)器人技術(shù)及應(yīng)用
- IoT Penetration Testing Cookbook
- Apache Hive Essentials
- Hands-On Linux for Architects
- 青少年VEX IQ機(jī)器人實(shí)訓(xùn)課程(初級)
- 生成對抗網(wǎng)絡(luò)項(xiàng)目實(shí)戰(zhàn)
- 與人共融機(jī)器人的關(guān)節(jié)力矩測量技術(shù)
- 西門子S7-1200/1500 PLC從入門到精通
- 從實(shí)踐中學(xué)嵌入式Linux操作系統(tǒng)
- Deployment with Docker
- 人工智能產(chǎn)品經(jīng)理:從零開始玩轉(zhuǎn)AI產(chǎn)品
- Network Science with Python and NetworkX Quick Start Guide
- 瘋狂Java實(shí)戰(zhàn)演義
- AlphaGo如何戰(zhàn)勝人類圍棋大師:智能硬件TensorFlow實(shí)踐