Compare commits
3 Commits
7b1465fc4e
...
424b9882bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 424b9882bb | |||
| c46757f76f | |||
| 15b1c485d2 |
@@ -34,23 +34,6 @@ select r.ctid, r.* from study.r;
|
||||
|
||||
-- 删除一条
|
||||
delete from study.r where id = 2;
|
||||
-- 再重新查询,得到
|
||||
-- 在重新查询,得到
|
||||
-- "(0,1)",1,101
|
||||
-- "(0,3)",3,103
|
||||
-- PostgreSQL 会保留空槽
|
||||
|
||||
-- 插入新数据
|
||||
insert into study.r values (104, 4);
|
||||
-- 再重新查询,得到
|
||||
-- "(0,1)",1,101
|
||||
-- "(0,3)",3,103
|
||||
-- "(0,4)",4,104
|
||||
-- 可以看到使用了末尾的新槽位,而不是使用中间的新槽位
|
||||
|
||||
-- 执行清理
|
||||
vacuum full study.r;
|
||||
-- 再次扫面,得到
|
||||
-- "(0,1)",1,101
|
||||
-- "(0,2)",3,103
|
||||
-- "(0,3)",4,104
|
||||
-- 看到空间已经回收
|
||||
|
||||
Reference in New Issue
Block a user