数据库索引

索引名称使用场景
B-tree 索引适合处理那些能够按顺序存储的数据
Hash 索引只能处理简单的等于比较
GiST 索引一种索引架构
GIN 索引反转索引,处理包含多个值的键
# 创建索引
create index 索引名 on 表名 (字段名);
create index test on mytable (name);
# 删除索引
drop index 索引名;
drop index test;