由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - performance problem in Oracle Package
相关主题
How to split a column into several rows?mysql mapping and insert question
mySQL 问题 (转载)请教一个SQL Server的面试题
sql query helpAccess 里面两个 column不一样的table 能combine 到一起吗?
菜鸟问题,急高手请进
A rookie's query questionany group function reutrn null if there is null value?
问个sql/ ssis的问题 谢谢!SQL 2008 Group By Question
sql 请教sql 题目求助
一个oracle performance 的问题。谁能帮我看看这个Insert语句要怎么改一下?
相关话题的讨论汇总
话题: package话题: subtab2话题: select话题: oracle
进入Database版参与讨论
1 (共1页)
o**y
发帖数: 1466
1
I have written a procedure in a package but the performance is very slow
which takes forever to execute. After more than 1 hour now it is still
spinning. however if I run the exactly the same code within developer
without using package, the performance is totally different, and it just
takes only about 3 minutes. The pseudo code is:
insert into tab3 (.......)
with subtab1 as
(select about 27000 rows from tab1, tab2 where join_sth),
subtab2 as
(select *, function_in_the_package_deal_with_Geomtry(col1,col2)) from
subtab1),
subtab3 as
(select * from subtab2 where resultofFunctionCol = sth)
select * from subtab3;
The tab1 and tab2 both have about 1 million records and each table has a
spatial geometry column and the user-defined function is to deal with the
Geometry columns.
Where is the issue? I am just a normal db user without any high privileges
in dba. I just cannot understand why the performance is so different. Again,
it is the exactly identical script. The only difference is using package or
not.
Any input will be highly appreciated! Thank you very much!!
d****n
发帖数: 12461
2
你这个subtab2没用啊?去掉应该可以加快很多。
sql developer只返回前50行记录。
o**y
发帖数: 1466
3
Thank you! subtab2 is used. I just changed the pseudo code. Thank you!!
o**y
发帖数: 1466
4
I found the reason after the proc call was completed.
It is a very stupid mistake. One of the parameters in the procedure is the
same name as one of the column names which caused the rows were not filtered!
So here is my stupid:
procedure xyz(p1, p2) as
begin
select sth from tab t where t.p1 = p1;
end;
all of the rows are returned!! Shame on me!
Thank you dynkin!
and Thank you every one!
c*****d
发帖数: 6045
5
这个错误太不应该了
另外那3个临时表都可以去掉
用一个sql语句应该可以搞定

filtered!

【在 o**y 的大作中提到】
: I found the reason after the proc call was completed.
: It is a very stupid mistake. One of the parameters in the procedure is the
: same name as one of the column names which caused the rows were not filtered!
: So here is my stupid:
: procedure xyz(p1, p2) as
: begin
: select sth from tab t where t.p1 = p1;
: end;
: all of the rows are returned!! Shame on me!
: Thank you dynkin!

1 (共1页)
进入Database版参与讨论
相关主题
谁能帮我看看这个Insert语句要怎么改一下?A rookie's query question
请教一个query 优化的问题(filter keyword)问个sql/ ssis的问题 谢谢!
请教一个SQL的问题sql 请教
sort two same tables SQL but different results一个oracle performance 的问题。
How to split a column into several rows?mysql mapping and insert question
mySQL 问题 (转载)请教一个SQL Server的面试题
sql query helpAccess 里面两个 column不一样的table 能combine 到一起吗?
菜鸟问题,急高手请进
相关话题的讨论汇总
话题: package话题: subtab2话题: select话题: oracle