order by doc_oid打乱了索引顺序,当然慢

解决方案 »

  1.   

    select a.column_oid,a.doc_oid, c.lable value 
     from f_item a,f_column b,f_refitem c,(select doc_oid from f_document   
                                                         where supdoc = ? 
                                               union 
                                             select '?' from dual) d
     Where a.column_oid = b.column_oid 
     and b.ref_id != -1 and b.type !=5 
     and b.ref_id = c.ref_oid and a.value = c.value 
     and a.doc_oid =d.doc_iod
      

  2.   

    建议不要用in,如果可以用exists来代替,尽量用exists来代替