posts - 25, comments - 69, trackbacks - 0, articles - 2
同样的一条语句,一条是在pl/sql里面组装成sql之后提交执行,另外一条是用pro*c程序后绑定执行,没想到执行策略和效率天差地别。看来做什么事都不能想当然,要细心学习才行。保留此条语句以做纪念:

select *
  from (select /*+ INDEX(A IDX_HISBUFAREJOUR_ACCOUNT) +*/
         a.*, f.sort_name
          from hs_his.hisbufarejour a, hs_fund.faresort f
         where (((((((a.fare_sort = f.fare_sort and a.client_id = :b0) and
               (:b1 = 0 or a.fund_account = :b2)) and
               a.init_date >= :b3) and a.init_date <= :b4) and
               (trim(:b5) is null or
               instr(((',' || :b6) || ','),
                         ((',' || a.exchange_type) || ',')) > 0)) and
               (trim(:b7) is null or
               instr(((',' || :b8) || ','),
                        ((',' || a.money_type) || ',')) > 0)) and
               (trim(:b9) is null or a.position_str > :b10))
         order by a.position_str)
 where rownum <= :b11


      
b0:130330000516
b1:595995
b2:595995
b3:20061221
b4:20061221
b5:1
b6:1
b7:2
b8:2
b9:
b10:
b11:30

Feedback

# re: 郁闷的问题:oracle pl/sql 和 pro c中的执行策略  回复  更多评论   

2006-12-22 21:47 by proc
还有人在用proc这么古老的东西,又是日本项目吧

只有注册用户登录后才能发表评论。


网站导航: