PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹11. 䘵嚘媆誕嬉誕

11.8. Operator Classes

垔幬䘵嚘䔇劯施埇傖婺䘵嚘䔇懟婻庖枕弄滯婔婻淉嘩严䌂

CREATE INDEX name ON table (column opclass [, ...]);

認婻淉嘩严䌂毺滯臖䘵嚘䫘庯臖庖枕施襕嘪䫘䔇淉嘩严㔗冋套婔婻婘 int4 婪䔇 B-tree 䘵嚘儖嘪䫘 int4_ops 䌂認婻淉嘩严䌂寙拸䫘庯 int4 䔇懫膄庘昄㔗垂鍙婪庖枕䌂傋䔇䚺䩕淉嘩严锔婩儌轿崘庖㔗拖橬淉嘩严䌂䔇婂襕寘啹滇凹庯昊底昄扞䌂傋埇脘庻婘崔婻橬懟幬䔇䘵嚘臯婺㔗冋套潏傸埇脘愿毐废婴婻崉昄斵埇脘锔誺䂺凹唚幘埇脘锔誺垂鄘㔗潏傸埇傖锔誺婺臖昄扞䌂傋垔幬婴婻淉嘩严䌂䇽劯婘傺䆋䘵嚘施锬拷劽锗䔇闼婻㔗

鍴庖䚺䩕䔇傖崡誻橬婔底橬喙䘞䔇淉嘩严䌂

婋麵䔇昖臵滆䴺欔橬噾垔幬䔇淉嘩严䌂

SELECT am.amname AS index_method,
       opc.opcname AS opclass_name
    FROM pg_am am, pg_opclass opc
    WHERE opc.opcamid = am.oid
    ORDER BY index_method, opclass_name;

潏傸埇傖檪垄欷匘婺滆䴺懟婻臘婺䔇欔橬淉嘩严

SELECT am.amname AS index_method,
       opc.opcname AS opclass_name,
       opr.oid::regoperator AS opclass_operator
    FROM pg_am am, pg_opclass opc, pg_amop amop, pg_operator opr
    WHERE opc.opcamid = am.oid AND
          amop.amopclaid = opc.oid AND
          amop.amopopr = opr.oid
    ORDER BY index_method, opclass_name, opclass_operator;

劯锔饡釕嬉誕
鄘彖䘵嚘婪婔亓演昖䘵嚘䔇嘪䫘