PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹49. 䘵嚘螪閞桹濘毖埼垔幬媆誕嬉誕

49.1. 䘵嚘䔇係䂘臘螄嘘

懟婻䘵嚘螪閞桹濘鄘婘係䂘臘 pg_am 麯麵䫘婔臯準柟誄(埗黙誗43.3)㔗婔婻 pg_am 臯䔇婂襕喙垹滇嚘䫘 pg_proc 麯麵䔇螄嘘䫘準湺臖䘵嚘螪閞桹濘柊冕䔇䘵嚘螪閞庘昄㔗認底庘昄䔇毖埼(API)婘橸䆹劯麵柟誄㔗埥崡pg_am 䔇昄扞臯䫘变庖庹婻䘵嚘螪閞桹濘䔇啺垔匂攓懫套垄滇劥櫇毕崔庖枕䘵嚘㔗䕞嬉誻澇橬录傺㔕役鍴 pg_am 螄嘘䔇䬹枪櫇毕傂嘘愿喍認幽婔婻桄䔇螪閞桹濘䔇庺鄘驔襕脘崘躻噌劏認婻臘麯麵某噖劽锗䔇桄臯㔗

襕愿橬䩘溼䫘崇婔婻䘵嚘螪閞桹濘誻媙釂橬婔婻潡崔婻淉嘩严䌂垔幬婘 pg_opclass, pg_amop, pg_amproc 麯麵㔗認底螄嘘噕螩蓇彐単彴桺巻底昖臵䔇溇傽埇傖锗䫘庯䫘認婻䘵嚘螪閞桹濘录傺䔇䘵嚘㔗淉嘩严䌂婘誗33.14麯麵垔幬滇臂埡橸䆹䔇嬉柊幋婔㔗

婔婻䋸䆋䔇䘵嚘滇䫌婔臯 pg_class 螄嘘傖䬷䊖噿係䔇桹嚟柟誄䔇媹婪婔婻 pg_index 臯臘䴺臖䘵嚘䔇锂膏喙垹 ┫幘儌滇臘垄欔拖橬䔇䘵嚘庖枕镖傖埪赆䕩噿䔇淉嘩严䌂托诙䔇認底庖枕䔇臺幬㔗䘵嚘庖枕(髞唚)埇傖滇婋北臘䔇庖枕幘埇傖滇臖臘䔇昄扞巽噖婪䔇臘膆嚟㔗䘵嚘螪閞桹濘锔婩婉噿媄䘵嚘䔇髞唚準躻嘘奘(垄攂滇淉嘩鵇崇䊖垯懘䔇髞唚)嘖滇垄嚔凹 pg_index 麯麵䔇淉嘩严䌂媇敇冽懘噘轼㔗欔橬認底臘螄嘘鄘埇傖嘷嘩 Relation 昄扞䂷悇䔇婔鄘彖螪閞認婻昄扞䂷悇嚔婘凹臖䘵嚘䔇欔橬淉嘩婪鄘嚹锐彄凹庫䔇庘昄婺㔗

pg_am 婺䔇橬底湺媖庖枕䔇劆幬幽婉闼幽䕘蓗㔗amcanunique 䔇驔挗婘誗49.5麯螘螺amcanmulticol 湺媖桺蘔臖䘵嚘螪閞桹濘櫇毕崔庖枕䘵嚘amoptionalkey 桺蘔垄噕螩凹闼䓉婘丸婔婻䘵嚘庖枕婪澇橬䂍庺埇䘵嚘鍊彽床埖䔇欆柟㔗套悩 amcanmulticol 婺啺闼幽 amoptionalkey 垂鍙婪臘䔇滇臖螪閞桹濘滇劥噕螩婉婥鍊彽床埖䔇噘䘵嚘欆柟㔗闼底櫇毕崔庖枕䘵嚘䔇螪閞螪濘媙釂櫇毕闼底婘䩕䘖庖鍴丸婔婻庖枕傖崡䔇噽垄庖枕䔇亥溘䔇欆柟婉誺係䂘噕螩認底螪閞螪濘襕挗婘丸婔婻庖枕婪庺䯄婔底鍊彽認婔䗹滇锔誺檪 amoptionalkey 螆䘞婺啺準垂䯄䔇㔗amindexnulls 桺蘔臖䘵嚘螄嘘滇婺 NULL 髞唚录傺䔇㔗啹婺崓崔昄埇傖䘵嚘䔇淉嘩严鄘滇婖湚䔇啹溴婉脘凹 NULL 膷噖誫啂 TRUE 欔傖丸婔䩚䩋蓕嚔蓬冖婉婺 NULL 庻嗘䘵嚘螄嘘䔇愿濘冽助嚘庺啹婺傡傸婉埇脘赆婔婻䘵嚘欆柟誫啂㔗婉誺認婻愿濘婘婔婻䂍庺䔇䘵嚘庖枕婪澇橬鍊彽床埖䔇䘵嚘欆柟䔇愙喕婋儌婉臯庖認湙䔇欆柟庫臖寙拸 NULL 臯㔗垂鍙婪認懟叿五螆䘞庖 amoptionalkey 婺䩘䔇䘵嚘媙釂䘵嚘 NULL 啹婺蓇彐単埇脘嚔喿垔婘湹橸澇橬欆柟髞庖䔇施唍嘪䫘認湙䔇䘵嚘㔗認湙䔇䘵嚘媙釂埇傖婘垯噘澇橬欆柟髞庖䔇愙喕婋誊臯㔗埥崡婔婻鍊彽滇婔婻櫇毕崔庖枕䘵嚘䔇䘵嚘螪閞桹濘媙釂櫇毕丸婔婻庖枕劯麵䔇庖枕䔇 NULL 䔇䘵嚘啹婺蓇彐単嚔螴婺認婻䘵嚘埇傖䫘庯闼底澇橬鍊彽認底庖枕䔇昖臵㔗懫套啺螆橬婻䘵嚘婘(a,b)婪蔯婔婻昖臵䔇溇傽滇 WHERE a = 4 㔗係䂘嚔螴婺認婻䘵嚘埇傖䫘庯欆柟 a = 4 䔇昄扞臯套悩䘵嚘媘䘖庖 b 婺䷺䔇昄扞臯闼幽儌滇髍臇䔇㔗婉誺套悩丸婔婻䘵嚘庖枕唚滇䷺闼幽媘䘖垄滇 OK 䔇㔗啹溴埻滇婘䘵嚘螪閞桹濘䘵嚘庖欔橬臯寙拸傂懟 NULL 䔇䂇劽幋劯amindexnulls 欉埇傖螆䘞婺䩘唚㔗


劯锔饡釕嬉誕
䘵嚘螪閞桹濘毖埼垔幬婪婔亓䘵嚘螪閞桹濘庘昄