文章目录环境症状问题原因解决方案报错编码环境系统平台N/A版本10.3症状对表执行vaccum操作时提示索引相关的错误信息如下testdb# vacuum testtable01; ERROR: left link changed unexpectedly in block 73592 of index index_col01 testdb# vacuum freeze testtable01; ERROR: left link changed unexpectedly in block 73592 of index index_col01问题原因index_col01索引文件损坏导致在73592 块上获取到的索引页的链表结构被破坏了需要重建索引修复。解决方案重建索引解决。命令如下方式一不开并行重建索testdb# reindex index index_col01;注PostgreSQL 10.3不支持并行重建索引这样重建索引会锁表会阻塞DML操作建议在业务空闲期间操作。方式二先建立新索引再删掉老的索引testdb# create index CONCURRENTLY index_col02 on testtable01(col1);CREATEINDEXtestdb# drop index index_col01;DROPINDEX注因为postgresql10.3 不能并发的重建旧的索引可以通过先建后删的方法在postgresql10.3下可以避免reindex阻塞其他DML。报错编码left link changed unexpectedly in block of index
left link changed unexpectedly in block xxxx of index ““index_xxxxx“
文章目录环境症状问题原因解决方案报错编码环境系统平台N/A版本10.3症状对表执行vaccum操作时提示索引相关的错误信息如下testdb# vacuum testtable01; ERROR: left link changed unexpectedly in block 73592 of index index_col01 testdb# vacuum freeze testtable01; ERROR: left link changed unexpectedly in block 73592 of index index_col01问题原因index_col01索引文件损坏导致在73592 块上获取到的索引页的链表结构被破坏了需要重建索引修复。解决方案重建索引解决。命令如下方式一不开并行重建索testdb# reindex index index_col01;注PostgreSQL 10.3不支持并行重建索引这样重建索引会锁表会阻塞DML操作建议在业务空闲期间操作。方式二先建立新索引再删掉老的索引testdb# create index CONCURRENTLY index_col02 on testtable01(col1);CREATEINDEXtestdb# drop index index_col01;DROPINDEX注因为postgresql10.3 不能并发的重建旧的索引可以通过先建后删的方法在postgresql10.3下可以避免reindex阻塞其他DML。报错编码left link changed unexpectedly in block of index