Postgres Index

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2021 Oct 12 5:13
Editor
Edited
Edited
2025 Jul 10 21:6
Refs
Refs
 
 
 

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
 
 

Backlinks

PostgreSQL

Recommendations