摘要: 【测试方法】 insert into t1 select generate_series(1,227);postgres=# insert into t1 select generate_series(1,227); INSERT 0 227文件16KB postgres=# select pg_r 阅读全文
posted @ 2021-09-20 11:48 stupidstan2019 阅读(34) 评论(0) 推荐(0)
摘要: 【结构】 【插入变化】 阅读全文
posted @ 2021-09-20 11:25 stupidstan2019 阅读(30) 评论(0) 推荐(0)
摘要: 【测试方法】 insert into t1(id) values(2); update t1 set id=3; 执行vacuum t1; 【测试结果】 第一行 lp->lp_off :从8128变为8160 【代码入口】 compactify_tuples 阅读全文
posted @ 2021-09-20 11:24 stupidstan2019 阅读(44) 评论(0) 推荐(0)
摘要: 【测试方法】 begin; select 1; 【snapshotData判断字段】 xmin, xmax 【代码】 [当前session] 开启事务后,第一个语句触发创建快照 入口函数:GetTransactionSnapshot 1)先生成快照 2)调用push,放到memoryContex里 阅读全文
posted @ 2021-09-20 10:04 stupidstan2019 阅读(82) 评论(0) 推荐(0)
摘要: 【测试方法】 插入一行数据 session1:开启事务,更新这一行,不提交 session2:select * from t1; 【代码过程】 HeapTupleSatisfiesMVCC函数 1)session1能看到第二行 1.1) 1015行,TransactionIdIsCurrentTra 阅读全文
posted @ 2021-09-20 01:25 stupidstan2019 阅读(94) 评论(0) 推荐(0)
摘要: 【调用入口】 【整体流程】 1)生成tuple对象 一共28字节 2)找到page和指定行 3)拷贝数据到page里 4)插入wal日志 【数据内容】 图示 【参考】 https://blog.csdn.net/postgres20/article/details/63290072 阅读全文
posted @ 2021-09-19 22:15 stupidstan2019 阅读(185) 评论(0) 推荐(0)
摘要: 【tuple结构代码】 计算t_bits offset看上去应该是32,结果是23 【相关逻辑】 1) (type*)0 一个 type 类型的NULL指针用这个指针访问结构体内的成员是非法的 2)&(((type*)0)->field)计算 field 的地址 ,编译器不会产生访问 field 的 阅读全文
posted @ 2021-09-19 16:46 stupidstan2019 阅读(282) 评论(0) 推荐(0)
摘要: 【调用栈】 【业务逻辑】 【数据结构】 【参考】 https://zhuanlan.zhihu.com/p/100424042 阅读全文
posted @ 2021-09-19 10:59 stupidstan2019 阅读(37) 评论(0) 推荐(0)
摘要: yum install -y cloc cloc oceanbase 1)mysql 273w行头文件 154w行c++文件 其中boost目录 181w行头文件 2)pg11 92w行代码 头文件13w行 polardb,94w行代码,只多2万行 2.1)polardb 3)oceanbase 阅读全文
posted @ 2021-09-12 20:20 stupidstan2019 阅读(612) 评论(0) 推荐(0)
摘要: https://blog.csdn.net/cuichao1900/article/details/100394801 ExecVacuum->vacuum->vacuum_rel->heap_vacuum_rel->lazy_scan_heap->lazy_vacuum_index函数的实现逻辑, 阅读全文
posted @ 2021-09-03 00:17 stupidstan2019 阅读(142) 评论(0) 推荐(0)