Posted on 2006-12-22 17:45
壯士日志 閱讀(566)
評論(1) 編輯 收藏 所屬分類:
編程技術(shù)
同樣的一條語句,一條是在pl/sql里面組裝成sql之后提交執(zhí)行,另外一條是用pro*c程序后綁定執(zhí)行,沒想到執(zhí)行策略和效率天差地別。看來做什么事都不能想當(dāng)然,要細(xì)心學(xué)習(xí)才行。保留此條語句以做紀(jì)念:
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