postgre索引
1.创建一般索引
单字段索引:
CREATE INDEX index_name ON table_name (field1);
联合索引:
CREATE INDEX index_name ON table_name (field1,field2);
2.条件(部分)索引:
CREATE INDEX index_name ON table_name (field1) WHERE field1 > 100;
3.重建索引
REINDEX INDEX my_index;
REINDEX TABLE my_table;
REINDEX DATABASE broken_db;