如何修复PostgreSQL错误告诉tid从新的索引元组重叠与无效重复元组?

eqoofvh9  于 2023-05-17  发布在  PostgreSQL
关注(0)|答案(1)|浏览(99)

当从Spring-Boot应用程序向我的一个表(具有多个索引)插入新行时,我有时会得到:

ERROR: table tid from new index tuple (952367,9) overlaps with invalid duplicate tuple at offset 12 of block 49008 in index "foo_index"
ERROR: table tid from new index tuple (952110,19) overlaps with invalid duplicate tuple at offset 22 of block 31693 in index "bar_index"
ERROR: table tid from new index tuple (953430,24) overlaps with invalid duplicate tuple at offset 22 of block 31693 in index "bar_index"
ERROR: table tid from new index tuple (953440,39) overlaps with invalid duplicate tuple at offset 23 of block 31693 in index "bar_index"
ERROR: table tid from new index tuple (952368,27) overlaps with invalid duplicate tuple at offset 76 of block 55849 in index "foo_index"
ERROR: table tid from new index tuple (952368,32) overlaps with invalid duplicate tuple at offset 76 of block 55849 in index "foo_index"
ERROR: table tid from new index tuple (953046,13) overlaps with invalid duplicate tuple at offset 12 of block 49008 in index "foo_index"

所有这些都遵循警告SQL Error: 0, SQLState: XX002,根据PostgreSQL docs,这意味着index_corrupted
服务器版本为Ubuntu 13.9-1.pgdg22.04+1
我能做些什么来修复它?

mklgxw1f

mklgxw1f1#

运行REINDEX (VERBOSE) TABLE CONCURRENTLY my_table;。花了~30分钟。(该表有大约3000万行。)到目前为止,错误没有再次出现。

相关问题