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

49.4. 䘵嚘髕䔇蔄麟

䘵嚘螪閞桹濘媙釂櫇毕崔婻誕䘋凹䘵嚘䔇幽埏敘桄㔗婘䘵嚘欆柟橘閘PostgreSQL 湩媄係䂘婘䘵嚘婪檷埡 AccessShareLock 幽婫婘敘桄䘵嚘橘閘(寙拸 VACUUM)幘嚔檷埡 RowExclusiveLock 㔗啹婺認底髕䌂傋婉嚔喾仕欔傖螪閞桹濘橬蘼傂崇䊖傂嘘垄躻噌驔襕䔇敘䂖躘䔇髕驔挗㔗檪昘婻䘵嚘髕嘟䔇毐傡髕埻滇婘录傺启役鍴䘵嚘潡蔙 REINDEX, VACUUM FULL 䔇施唍嘪䫘㔗

录傺婔婻櫇毕幽埏敘桄䔇䘵嚘䌂傋锔婩襕挗凹欔驔䔇臯婺誕臯幪濕䔇幽婫䂖躘䔇彖悊㔗凹庯 b-tree 启 Hash 䘵嚘䌂傋嘹埇傖臂埡婘 src/backend/access/nbtree/READMEsrc/backend/access/hash/README 麯麵柟誄䔇螆螇喿亡㔗

鍴庖䘵嚘躻噌喙鄘䔇婔躘攓襕挗幋崡幽埏敘桄录傺庖婔底橬噿佽臘()启䘵嚘幋閘䔇婔躘攓閞鵻㔗啹婺 PostgreSQL 滇檪幖䔇螪閞启敘桄婯䘵嚘䔇螪閞启敘桄彖嚔䔇㔗䫘婋麵䔇蓇彍崇䊖認湙䔇閞鵻

澇橬丸婬溇蓇彍套悩婔婻䘵嚘滇幽埏䔇闼幽婔婻䘵嚘臂蔙滇埇脘婘婔溇䘵嚘螄嘘赆 VACUUM 役鍴幋嬉䩋彄垄䔇䇽劯婘 VACUUM 役鍴垄幋劯欆彄噽凹庫䔇幖螄嘘㔗套悩臂蔙彄膆臖釹施臖釹䚡埙傉䇽澇橬嘪䫘闼幽認䓉愙喕婉嚔凚躘婖麉䔇閞鵻啹婺䷺䔇釹擘嘉嚔赆 heap_fetch() 媘䘖㔗嘖滇套悩丸婬婻劯䆇噾䂟婺噽垄傔幽婩薪崉䫘庖認婻釹擘嘉埽套嘘?套悩嘪䫘 MVCC 噚垹䔇媆䙓闼幽儌婉嚔橬閞鵻啹婺桄剹扞䔇擘嘉嘷䇽滇崻桄庖啹蔯方濘锔誺媆䙓敋臘㔗嘖滇凹庯麂 MVCC 噚垹䔇媆䙓(懫套 SnapshotNow)闼幽儌橬埇脘毖埖幽誫啂婔婻垂鍙婪幽婉对陉欆柟髞庖䔇臯㔗埇傖锔誺襕挗欆柟髞庖婘欔橬婺劽婋鄘麉桄演昖䔇桹濘準镪噉認䓉愙喕嘖滇認䓉桹濘嚔體崻崓庖㔗埡蔯傼幋䔇滇锔誺婘䘵嚘釕麵婪嘪䫘婔婻體嘷嘩婔婻傼䊖只臬係䂘臘臂蔙埇脘誻婘凹庫幖螄嘘䔇䘵嚘螄嘘婪䷺"鼂臯"㔗婘認湙䔇體婪麵誕臯 ambulkdelete 庖䇞媺 VACUUM 方濘婘臂蔙垯潊臂埡幋嬉役鍴幖螄嘘㔗認䓉蓼濘嵂媹庖婔䗹䗹誊臯施嚔體蔯埻滇婘麂婩䘘蓕䔇垂鍙橬喾仕䔇愙喕婋欉凚躘黂凂嚔體㔗

認婻蓼喿桹濘襕挗䘵嚘欆柟媙釂滇"劯準䔇"媙釂婘欆柟垯凹庫䔇䘵嚘螄嘘幋劯鷸婪檷埡懟婻幖螄嘘㔗認湙䔇桹懽嚔體懫膄崓寘啹橬苖幾婻㔗蔯"嚗準䔇"欆柟埇傖噽傯䘵嚘麯櫽镖冽崔 TID 䇽劯喉䘉劯䔇昊施螪閞幖臯認湙儌嚔䄓冽崔䘵嚘髕䔇嚔體傖埪埇傖噕螩敘橬昽䔇幖螪閞昇嚟㔗嘖滇毬䙓婪麵䔇彖悊婘麂 MFCC 噚垹剘庖五婪媙釂嘪䫘劯準桹濘蔯凹嘪䫘 MVCC 媆䙓䔇昖臵嘪䫘嚗準欆柟庫臖滇埇傖垂䯄䔇㔗

amgetmulti 䘵嚘欆柟麯螪閞桹濘婉驔襕媺臕婘傂嘘誫啂䔇臯婪媺毕婔婻體㔗懘䆘鍴庖䂍橔劯婔婻臯媹體幋崡幘澇濘䂍噽垄䔇媹㔗啹溴埻脘婘 MVCC 噚垹䔇媆䙓麯嘪䫘認湙䔇欆柟㔗


劯锔饡釕嬉誕
䘵嚘欆柟婪婔亓䘵嚘嫇婔攓演昖