- 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.
- 高效能辦公必修課:Word圖文處理
- Visualforce Development Cookbook(Second Edition)
- Mastercam 2017數(shù)控加工自動編程經(jīng)典實(shí)例(第4版)
- 程序設(shè)計缺陷分析與實(shí)踐
- Windows 8應(yīng)用開發(fā)實(shí)戰(zhàn)
- 大數(shù)據(jù)時代
- 嵌入式操作系統(tǒng)
- Linux服務(wù)與安全管理
- 新編計算機(jī)組裝與維修
- 網(wǎng)站前臺設(shè)計綜合實(shí)訓(xùn)
- 邊緣智能:關(guān)鍵技術(shù)與落地實(shí)踐
- 單片機(jī)原理實(shí)用教程
- Ansible 2 Cloud Automation Cookbook
- Unreal Development Kit Game Design Cookbook
- 電腦故障排除與維護(hù)終極技巧金典