Update: Heikki’s slides are here! Heikki Linnakangas gave a presentation this past Sunday at FOSDEM about the improved free space map (FSM), which tracks unused space inside the database, and new visibility map, a bitmap which will indicate which dat…
根目录介绍 data ├── base # use to store database file(SELECT oid, datname FROM pg_database;) ├── global # under global, all the filenode is hard-code(select oid,relname,relfilenode from pg_class where relfilenode=0 order by oid;) ├── pg_clog # dir of tran…
先说 heap_insert 函数: /* * heap_insert - insert tuple into a heap * * The new tuple is stamped with current transaction ID and the specified * command ID. * * If the HEAP_INSERT_SKIP_WAL option is specified, the new tuple is not * logged in WAL, even fo…
当PostgreSQL需要insert 一条记录的时候,它会把记录头放入xmin,xmax等字段. xmin的值,就是当前的Transaction的TransactionId.这是为了满足MVCC的需要. 跟踪程序进行了解: /* * Allocate the next XID for a new transaction or subtransaction. * * The new XID is also stored into MyProc before returning. * * Note…