Reindex
Postgres BTREE index cannot be created if the index entry size exceeds 1/3 (≈2.7KB) of the disk page (8KB), so large text is stored outside the page using the TOAST technique. However, using TOASTed values directly in unique indexes causes performance degradation. Only B-Tree efficiently supports unique constraints, while Hash indexes are unsuitable as they require full value comparison during collisions. Therefore, it's recommended to create a generated column storing MD5 or SHA-256 hash values of large text and apply a unique B-Tree index to that column