PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹53. BKI 劯䆇毖埼媆誕嬉誕

53.2. BKI 变傴

create [bootstrap] [shared_relation] [without_oids] tablename tableoid (name1 = type1 [, name2 = type2, ...])

录傺婔婻劉婺 tablename 幽婫 OID 婺 tableoid 䔇臘臘庖枕婘婖拸嚓婺䂍庺㔗

bootstrap.c 䕘毖櫇毕婋彖庖枕䌂傋bool, bytea, char(1庖誗), name, int2, int4, regproc, regclass, regtype, text, oid, tid, xid, cid, int2vector, oidvector, _int4(昄䂇), _text(昄䂇), _oid(昄䂇), _char(昄䂇), _aclitem(昄䂇)㔗儘䞇埇傖录傺寙劆噽垄䌂傋庖枕䔇臘嘖滇埻橬婘录傺垯 pg_type 幽婫准噙庖劽锗䔇螄嘘幋劯欉臯㔗認垂鍙婪儌懟叿五婘係䂘彺哋寡臘婺埻脘嘪䫘認底庖枕䌂傋蔯麂係䂘彺哋寡臘埇傖嘪䫘傂懟喙䘞䌂傋㔗

套悩弄滯庖 bootstrap 闼幽儖埻婘伕䕻婪录傺臘婉嚔劏 pg_class, pg_attribute 京係䂘臘麯麵膷噖傂嘘婩薪㔗啹溴認湙䔇臘儖方濘赆捞锔䔇 SQL 淉嘩螪閞䕘彄闼底螄嘘䫘䇸媂濘(䫘 insert 变傴)准噖㔗認婻锬釹䫘庯录傺 pg_class 京躻躆㔗

套悩弄滯庖 shared_relation 闼幽臘儌嘩婺噌庆臘录傺㔗鍴麂弄滯庖 without_oids 劥彍儖嚔橬 OID 㔗

open tablename

欷嚔婔婻劉婺 tablename 䔇臘庖崺某噖昄扞㔗傂嘘嘷嬉噾䂟欷嚔䔇臘鄘嚔赆噿閺㔗

close [tablename]

噿閺欷嚔䔇臘㔗䂍庺䔇臘劉䫘庯庴埬演昖嘖幽婉滇媙釂䔇㔗

insert [OID = oid_value] ( value1 value2 ... )

套悩 oid_value 婺镽闼幽䫘 value1, value2 京嘩婺庖枕唚傖埪 oid_value 嘩婺噽 OID(凹茇湺臖)劏欷嚔䔇臘某噖婔溇桄螄嘘劥彍䩕䘖床埖蔯臘彍拖橬 OID 幽蕋庽婋婔婻埇䫘䔇 OID 昄唚㔗

NULL 埇傖䫘䬹枪䔇噿髞庖 _null_ 弄滯㔗寙劆䷺䍘䔇唚媙釂䫘埯嚘埙湺蕙㔗

declare [unique] index indexname indexoid on tablename using amname ( opclass1 name1 [, ...] )

婘婔婻埆 tablename 䔇臘婪䫘 amname 螪閞桹濘录傺婔婻 OID 滇 indexoid 䔇埆啔 indexname 䔇䘵嚘㔗䘵嚘䔇庖枕埆 name1, name2 京蔯嘪䫘䔇淉嘩严䌂彖彆滇 opclass1, opclass2 京㔗儖嚔录傺䘵嚘桺傽启敄嘷䔇係䂘臘螄嘘嘖滇䘵嚘喙垹婉嚔赆溴变傴彺哋寡㔗

declare toast toasttableoid toastindexoid on tablename

婺劉婺 tablename 䔇臘录傺婔婻 TOAST 臘㔗認婻 TOAST 䔇 OID 滇 toasttableoid 噽䘵嚘䔇 OID 滇 toastindexoid 㔗婯 declare index 婔湙䘵嚘䔇准噙嚔赆毘誘㔗

build indices

准噙嬉麵弄滯䔇䘵嚘㔗


劯锔饡釕嬉誕
BKI 桺傽湚嚟婪婔亓係䂘彺哋寡䔇 BKI 桺傽䔇䂷悇