- 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.
- Dreamweaver CS3 Ajax網(wǎng)頁設(shè)計(jì)入門與實(shí)例詳解
- 樂高創(chuàng)意機(jī)器人教程(中級 下冊 10~16歲) (青少年iCAN+創(chuàng)新創(chuàng)意實(shí)踐指導(dǎo)叢書)
- Docker High Performance(Second Edition)
- Hadoop應(yīng)用開發(fā)基礎(chǔ)
- SAP Business Intelligence Quick Start Guide
- 精通數(shù)據(jù)科學(xué):從線性回歸到深度學(xué)習(xí)
- 在實(shí)戰(zhàn)中成長:C++開發(fā)之路
- 網(wǎng)絡(luò)服務(wù)器搭建與管理
- 三菱FX/Q系列PLC工程實(shí)例詳解
- 智能+:制造業(yè)的智能化轉(zhuǎn)型
- PostgreSQL 10 High Performance
- Python語言從入門到精通
- Java Deep Learning Projects
- 歐姆龍PLC應(yīng)用系統(tǒng)設(shè)計(jì)實(shí)例精解
- 特征工程入門與實(shí)踐