473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

package takes long time to run insert statement

1
We have a package in production which has suddenly started consuming greater than normal time to execute. On debugging this further, we found the following:
The package takes 5 mins to come out.
The queries inside the package, if run seperately, come out in milliseconds in total.

On looking through the sql trace when the package was run, it was found that an insert on a global Temp table is consuming around 5 mins (elapsed = 310 secs).

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 55.55 310.37 396138 425556 19 65
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 55.55 310.37 396138 425556 19 65

However, if the same set of sqls are run from outside the package, they run in milliseconds (with same results of course)
So what is different in sqls running seperately, against running as part of a package? Why should the package take time?

Any clues or pointers to what might be happening?
There is activity seen on the temp tbs in the awr, which is expected because of the global temp tables.

Thanks in advance.
Jun 7 '07 #1
2 3923
We have a package in production which has suddenly started consuming greater than normal time to execute. On debugging this further, we found the following:
The package takes 5 mins to come out.
The queries inside the package, if run seperately, come out in milliseconds in total.

On looking through the sql trace when the package was run, it was found that an insert on a global Temp table is consuming around 5 mins (elapsed = 310 secs).

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 55.55 310.37 396138 425556 19 65
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 55.55 310.37 396138 425556 19 65

However, if the same set of sqls are run from outside the package, they run in milliseconds (with same results of course)
So what is different in sqls running seperately, against running as part of a package? Why should the package take time?

Any clues or pointers to what might be happening?
There is activity seen on the temp tbs in the awr, which is expected because of the global temp tables.

Thanks in advance.
I don't have any clues, but I request if you get any solution to this problem, can you please let me know. I am very interested about this
Jun 8 '07 #2
We have a package in production which has suddenly started consuming greater than normal time to execute. On debugging this further, we found the following:
The package takes 5 mins to come out.
The queries inside the package, if run seperately, come out in milliseconds in total.

On looking through the sql trace when the package was run, it was found that an insert on a global Temp table is consuming around 5 mins (elapsed = 310 secs).

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 55.55 310.37 396138 425556 19 65
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 55.55 310.37 396138 425556 19 65

However, if the same set of sqls are run from outside the package, they run in milliseconds (with same results of course)
So what is different in sqls running seperately, against running as part of a package? Why should the package take time?

Any clues or pointers to what might be happening?
There is activity seen on the temp tbs in the awr, which is expected because of the global temp tables.

Thanks in advance.
I can suggest a way to locate the pain area first. You can create a database table instead of the global temporary table and run the same package, now inserting into this datbase table. Then it would be evident if the time taken is due to insertion in a Global Temporary Table specifically or not.
Also, I can share one of my experiences with global temporary tables, may be it can give you any clue. My query joining a global temp table was taking a lot of time, but after I used the DYNAMIC_SAMPLING hint, the query executed in a flash
Jun 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Graham | last post by:
I need a SQL Server or ODBC package for Python. Can anyone help please? Have search the Python packages under Database and there is no reference to either SQL Server or ODBC. Thanks Graham
4
by: sjoshi | last post by:
Hello I have these tables: CREATE TABLE . ( NOT NULL , NOT NULL ) ON CREATE UNIQUE CLUSTERED INDEX ON .(, ) WITH FILLFACTOR = 90 ON
8
by: J.Haan | last post by:
Hi all. I'm currently coping with a problem on which I hope you could shed some light. Imagine the following: I have table in DB2 8.1 (.5) which is defined as: table test { t1 smallint,...
21
by: CBFalconer | last post by:
I released this under GPL some time ago, (2003-May) and have been advertising it occasionally here, where it seemed applicable. I have received no bug reports. I have just gotten around to...
7
by: nicholas | last post by:
I have a page that changes some data in an sql-server database: it inserts the categories for a selected product. The user checks some categories in a tree (with checkboxes). These are the...
2
by: Charles Wilt | last post by:
I have a IBM iSeries (aka AS-400) running v5r3 of OS/400 that I access via a linked server from SQL Server 2000. The following select works fine: select * from...
7
by: anilcool | last post by:
Hi all. I am running a stored procedure in a loop -- this Stored procedure inserts one record at a time. After inserting about 1326 records, my thread crashes and I get the following error:...
2
by: mivey4 | last post by:
Hi, I am not new to Oracle but I am new to creating packages. Trying to convert to Oracle from MSSQL and getting my feet wet I have created the following package that has 1 procedure in it. No...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.