2.PostgreSQL
Database · 4 篇笔记
- 2.PostgreSQLhistorical
1. SQL优化 - PostgreSQL explain.md 2. 事务 - PostgreSQL隔离级别.md - PostgreSQL MVCC.md
- 2.1 PostgreSQL隔离级别historical
1. 实现 PostgreSQL中根据获取快照时机的不同实现了不同的数据库隔离级别(对应代码中函数GetTransactionSnapshot): - Read UnCommited/Read Commited:每个query都会获取最新的快照CurrentSnapshotData - Repeta
- 2.2 PostgreSQL MVCChistorical
1. 总体规则 - 在PostgreSQL中,每一个事务都会得到一个被称作为 XID 的事务ID - 可以通过 select cast(txid current() as text) 查询 - 这里说的事务不仅仅是被 BEGIN - COMMIT 包裹的一组语句,还包括单条的 insert 、 up
- 2.3 PostgreSQL explainhistorical
1. 不加where 1.1. 普通的explain - 结果 1.1.1. 解析 - 读取的方式 - 顺序扫描,一块块读取 - 统计信息 - cost - 获取第一行的时间 - 获取所有行的时间 - 单位是page unit,不是毫秒 - rows - 扫描的行数 - width - 所有行的平均