最大可以查询oracle数据库的次数

时间:2012-02-03 10:38:44

标签: oracle oracle11g

我有一段代码如下。

 Select * from abc_table where objectsnames="obj1" or "obj2"......"Obj1000"

查询1000个对象。

如果我将此查询调用了一万次,是否有任何机会进行oracle超时?

1 个答案:

答案 0 :(得分:1)

我认为你想创建一个小对象名表然后加入,比如:

create table objectnames
(
  name varchar2(100)
);

-- populate objectnames
-- could be from a file or another table or whatever
insert into objectnames ... 
commit;

-- query from tables
select a.* 
from abc_table a, objectnames o
where a.objectname = o.name
;

您也可以使用EXISTS或IN语句,例如

select *
from abc_table
where objectname in (
  select name
  from objectnames
);