[英]Any ideas on why a 3rd party ODBC driver would run a query super slow from WCF service and super fast from normal console app?
[英]Slow query with odbc driver
我有一張有 1,000,000 條記錄的表。
create table CCM.SPVACTION_STOPPER
(
revision NUMBER default 0 not null,
heat_id VARCHAR2(16) default ' ' not null,
strand_num NUMBER default 0 not null,
stopper_position NUMBER default 0 not null,
speed_value NUMBER default 0,
mould_level NUMBER default 0,
ladel_net_steel_wgt NUMBER default 0,
tundish_net_steel_wgt NUMBER default 0,
ladel_calculation_steel_wgt NUMBER default 0,
casting_lenght NUMBER default 0
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Create/Recreate indexes
create index CCM.IND2_SPVSTOPP on CCM.SPVACTION_STOPPER (HEAT_ID)
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
create index CCM.IND3_SPVSTOPP on CCM.SPVACTION_STOPPER (REVISION)
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
create index CCM.IND_SPVSTOPP on CCM.SPVACTION_STOPPER (HEAT_ID, REVISION)
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
當我使用 ODBC 運行此查詢時
select * from ccm.spvaction_stopper
where heat_id = :heatID and rownum<10
在Command.ExecuteReader()
行中說錯誤
{"ERROR [HYT00] [Oracle][ODBC][Ora]ORA-01013: user requested cancel of current operation\n"}
但是當使用 OLEDB 驅動程序運行此查詢或運行 int PLSQl 時,運行時間不到 1 秒。
請幫助我使用 ODBC 快速運行此查詢。
(我使用 .net 框架4)
我將QTO=F
添加到連接字符串以防止
ORA-01013: user requested cancel of current operation
錯誤
QTO=F
用於禁用查詢超時。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.