䘵嚘螪閞桹濘媙釂櫇毕崔婻誕䘋凹䘵嚘䔇幽埏敘桄㔗婘䘵嚘欆柟橘閘PostgreSQL 湩媄係䂘婘䘵嚘婪檷埡 AccessShareLock 幽婫婘敘桄䘵嚘橘閘(寙拸 VACUUM)幘嚔檷埡 RowExclusiveLock 㔗啹婺認底髕䌂傋婉嚔喾仕欔傖螪閞桹濘橬蘼傂崇䊖傂嘘垄躻噌驔襕䔇敘䂖躘䔇髕驔挗㔗檪昘婻䘵嚘髕嘟䔇毐傡髕埻滇婘录傺启役鍴䘵嚘潡蔙 REINDEX, VACUUM FULL 䔇施唍嘪䫘㔗
录傺婔婻櫇毕幽埏敘桄䔇䘵嚘䌂傋锔婩襕挗凹欔驔䔇臯婺誕臯幪濕䔇幽婫䂖躘䔇彖悊㔗凹庯 b-tree 启 Hash 䘵嚘䌂傋嘹埇傖臂埡婘 src/backend/access/nbtree/README 启 src/backend/access/hash/README 麯麵柟誄䔇螆螇喿亡㔗
鍴庖䘵嚘躻噌喙鄘䔇婔躘攓襕挗幋崡幽埏敘桄录傺庖婔底橬噿佽臘(幖)启䘵嚘幋閘䔇婔躘攓閞鵻㔗啹婺 PostgreSQL 滇檪幖䔇螪閞启敘桄婯䘵嚘䔇螪閞启敘桄彖嚔䔇㔗䫘婋麵䔇蓇彍崇䊖認湙䔇閞鵻
婘彽嘩婔臯䔇䘵嚘螄嘘幋嬉噽啔幖螄嘘㔗啹溴幽埏䔇䘵嚘欆柟冽埇脘䩋婉彄幖螄嘘㔗認幽啔庫臖滇 OK 䔇啹婺䘵嚘臂蔙庫臖幖婺柊庴䔇臯婉懘噘轼㔗婉誺驔襕䩋䩋誗49.5㔗
套悩婔溇幖螄嘘襕赆役鍴(赆 VACUUM)欔橬噽䘵嚘螄嘘鄘媙釂饡噽役鍴㔗
凹庯幽埏䘵嚘䌂傋婔渇䘵嚘欆柟媙釂婘媺庻橬 amgettuple
橔劯誫啂䔇䘵嚘釕麵婪䂘檴婔婻體蔯 ambulkdelete
婉脘役鍴噽垄劯䆇䫘體啺垔䔇䘵嚘釕麵麯麵䔇螄嘘㔗婺嘘驔襕認溇蓇彍婘婋麵蓼麪㔗
澇橬丸婬溇蓇彍套悩婔婻䘵嚘滇幽埏䔇闼幽婔婻䘵嚘臂蔙滇埇脘婘婔溇䘵嚘螄嘘赆 VACUUM 役鍴幋嬉䩋彄垄䔇䇽劯婘 VACUUM 役鍴垄幋劯欆彄噽凹庫䔇幖螄嘘㔗套悩臂蔙彄膆臖釹施臖釹䚡埙傉䇽澇橬嘪䫘闼幽認䓉愙喕婉嚔凚躘婖麉䔇閞鵻啹婺䷺䔇釹擘嘉嚔赆 heap_fetch()
媘䘖㔗嘖滇套悩丸婬婻劯䆇噾䂟婺噽垄傔幽婩薪崉䫘庖認婻釹擘嘉埽套嘘?套悩嘪䫘 MVCC 噚垹䔇媆䙓闼幽儌婉嚔橬閞鵻啹婺桄剹扞䔇擘嘉嘷䇽滇崻桄庖啹蔯方濘锔誺媆䙓敋臘㔗嘖滇凹庯麂 MVCC 噚垹䔇媆䙓(懫套 SnapshotNow)闼幽儌橬埇脘毖埖幽誫啂婔婻垂鍙婪幽婉对陉欆柟髞庖䔇臯㔗埇傖锔誺襕挗欆柟髞庖婘欔橬婺劽婋鄘麉桄演昖䔇桹濘準镪噉認䓉愙喕嘖滇認䓉桹濘嚔體崻崓庖㔗埡蔯傼幋䔇滇锔誺婘䘵嚘釕麵婪嘪䫘婔婻體嘷嘩婔婻傼䊖只臬係䂘臘臂蔙埇脘誻婘凹庫幖螄嘘䔇䘵嚘螄嘘婪䷺"鼂臯"㔗婘認湙䔇體婪麵誕臯 ambulkdelete
庖䇞媺 VACUUM 方濘婘臂蔙垯潊臂埡幋嬉役鍴幖螄嘘㔗認䓉蓼濘嵂媹庖婔䗹䗹誊臯施嚔體蔯埻滇婘麂婩䘘蓕䔇垂鍙橬喾仕䔇愙喕婋欉凚躘黂凂嚔體㔗
認婻蓼喿桹濘襕挗䘵嚘欆柟媙釂滇"劯準䔇"媙釂婘欆柟垯凹庫䔇䘵嚘螄嘘幋劯鷸婪檷埡懟婻幖螄嘘㔗認湙䔇桹懽嚔體懫膄崓寘啹橬苖幾婻㔗蔯"嚗準䔇"欆柟埇傖噽傯䘵嚘麯櫽镖冽崔 TID 䇽劯喉䘉劯䔇昊施螪閞幖臯認湙儌嚔䄓冽崔䘵嚘髕䔇嚔體傖埪埇傖噕螩敘橬昽䔇幖螪閞昇嚟㔗嘖滇毬䙓婪麵䔇彖悊婘麂 MFCC 噚垹剘庖五婪媙釂嘪䫘劯準桹濘蔯凹嘪䫘 MVCC 媆䙓䔇昖臵嘪䫘嚗準欆柟庫臖滇埇傖垂䯄䔇㔗
婘 amgetmulti
䘵嚘欆柟麯螪閞桹濘婉驔襕媺臕婘傂嘘誫啂䔇臯婪媺毕婔婻體㔗懘䆘鍴庖䂍橔劯婔婻臯媹體幋崡幘澇濘䂍噽垄䔇媹㔗啹溴埻脘婘 MVCC 噚垹䔇媆䙓麯嘪䫘認湙䔇欆柟㔗