B-tree index and UNIQUE/PRIMARY constraints with collatable keys
expression index using collation-sensitive functions/operators
partition bounds and partitioned indexes
materialized views with ordered/normalized derived data
full-text and pg_trgm indexes called out by release notes
application pagination/bookmark built on locale ordering
cached sorted projections outside PostgreSQL
hash index 不保存排序,但 collation-sensitive equality 和业务去重仍需按实际 operator
语义验证。不能把“只重建所有 text B-tree”当成对任意扩展 operator class 的完整规则。
rebuild command and whether CONCURRENTLY is supported
lock and blocking behavior
temporary and final disk headroom
WAL volume and replica lag
unique collision handling
estimated duration from clone rehearsal
validation query and owner
顺序不能颠倒
正确顺序:
identify all affected objects
-> validate new equality/sort semantics
-> resolve unique conflicts
-> rebuild every affected object
-> run amcheck / query corpus
-> ALTER COLLATION ... REFRESH VERSION
-> verify mismatch set is empty
REFRESH VERSION 只把 catalog 中的 recorded version 更新为当前 provider version;
官方明确说明它不会检查对象是否已正确重建。若先 refresh,warning 消失了,旧索引
却还在,反而销毁了最显眼的故障信号。
数据库默认 collation 使用:
ALTERDATABASEappREFRESHCOLLATIONVERSION;
也同样必须在所有依赖对象重建后执行。
正式实验的反例
本章 runner 在一次性 PG17 cluster 中精确把:
app.en_numeric.collversion = pg36-injected-stale
actual ICU version = 153.121
affected index = app.orders_order_code_key