天天看点

odoo postgres 索引

查看索引

select * from pg_indexes where tablename='xx'; 

或者    

select * from pg_statio_all_indexes where relname='xx';

创建索引

create index picking_id_index on xx(picking_id);

create index  tbl_bb_index  on  tbl_bb(id,name);

注:tbl_bb  位表名称,  tbl_bb_index  为创建的索引名称,  id 和 name 为 表里的字段

删除索引

DROP INDEX index;  

index是要删除的索引名

注意 : 无法删除DBMS为主键约束和唯一约束自动创建的索引

--------------------- 

作者:非衣鲲化 

来源:CSDN 

原文:https://blog.csdn.net/qq_32157851/article/details/83684567 

版权声明:本文为博主原创文章,转载请附上博文链接!