繁体   English   中英

odbc驱动慢查询

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM