如何修复PostgreSQL错误,指示tid与无效的重复元组重叠的新索引元组?

huangapple go评论77阅读模式
英文:

How to fix PostgreSQL errors telling tid from new index tuple overlaps with invalid duplicate tuple?

问题

当从Spring-Boot应用程序向我的某个具有多个索引的表中插入新行时,有时会出现以下错误:

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文档,这意味着 index_corrupted

服务器版本为 Ubuntu 13.9-1.pgdg22.04+1

我应该采取什么措施来修复这个问题?

英文:

When inserting new rows to one of my tables (having multiple indexes) from a Spring-Boot application, I sometimes get:

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"

All these follow a warning SQL Error: 0, SQLState: XX002, which means index_corrupted according to the PostgreSQL docs.

The server version is Ubuntu 13.9-1.pgdg22.04+1.

What can I do to fix it?

答案1

得分: 0

"Ran REINDEX (VERBOSE) TABLE CONCURRENTLY my_table;. It took ~30 minutes. (The table has ~30M rows.) So far, the errors did not reappear."

英文:

Ran REINDEX (VERBOSE) TABLE CONCURRENTLY my_table;. It took ~30 minutes. (The table has ~30M rows.) So far, the errors did not reappear.

huangapple
  • 本文由 发表于 2023年5月15日 13:37:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76251129.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定