使用odbc驱动进行慢速查询

问题描述 投票:0回答:1

我有一个有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 framework4)

c# oracle odbc oledb .net-framework-version
1个回答
0
投票

我添加 QTO=F 连接字符串,以防止

ORA-01013: user requested cancel of current operation

错误

QTO=F 用于禁止查询超时。

© www.soinside.com 2019 - 2024. All rights reserved.