现在我在postgresql 中已经创建了一个索引CREATE INDEX test_noticetable ON noticepaddefinfo 
(placeid,structureid,delflag,teamid,projectid)我要在以下sql语句中使用,请问怎么用?
select 
noticepadid,noticepadname,notenum,unclosenum,updateday,deleteupdate,whetherclose,statusdef,templatename,delflag,originalname
from noticepaddefinfo 
where placeid=‘hh’ and structureid='aa' and delflag ='0'  and teamid='kk' and projectid='jj' order by noticepadid即postgresql中索引在select语句中的使用方法 

解决方案 »

  1.   

    noticepadid上可以建一个单独的索引
      

  2.   

    索引用数据库系统自行分析决定是否调用。当数据中收到一个SQL语句的请求后,数据库系统会进行语法分析,然后进行执行计划的安排,在执行计划的制定中会根据数据字典中的索引,字段,记录数量等信息决定最终的执行计划。