473,396 Members | 2,111 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.

Performance improvement for Stored Proc resolution

Hello IBM

I think that one could improve the performance of DB2 UDB v7.2's
stored procedure resolution. Here's what DB2 normally does:

SELECT A.PROCSCHEMA, A.PROCNAME, A.PARMNAME, A.TYPESCHEMA, A.TYPENAME,
A.LENGTH,
A.SCALE, A.PARM_MODE, A.ORDINAL, A.CODEPAGE FROM "SYSIBM".SYSPROCPARMS
A,
"SYSIBM".SYSPROCEDURES B WHERE A.PROCSCHEMA = 'UMBNT'AND A.PROCNAME =
'GETBYNAME_NUMBERCYCLE' AND A.SPECIFICNAME = B.SPECIFICNAME AND
A.PROCSCHEMA =
B.PROCSCHEMA AND B.PARM_COUNT = 2 ORDER BY 1, 2, 9

If you explain this statement, however, you will see that it results
in a scan of the table SYSPROCPARMS. Simply rephrasing the query as
follows will eliminate the scan (note how the name now restricts
SYSPROCEDURES so the index is used):

SELECT
B.PROCSCHEMA
, B.PROCNAME
, A.PARMNAME
, A.TYPESCHEMA
, A.TYPENAME
, A.LENGTH
, A.SCALE
, A.PARM_MODE
, A.ORDINAL
, A.CODEPAGE
FROM "SYSIBM".SYSPROCPARMS A
, "SYSIBM".SYSPROCEDURES B
WHERE B.PROCSCHEMA = 'UMBNT'
AND B.PROCNAME = 'GETBYNAME_NUMBERCYCLE'
AND A.SPECIFICNAME = B.SPECIFICNAME
AND A.PROCSCHEMA = B.PROCSCHEMA
AND B.PARM_COUNT = 2
ORDER BY 1, 2, 9

While on most systems, the actual performance improvement will be
negligible, it does matter on systems with lots of procedures.

It also does not artificially degrade the ratio of rows read vs rows
selected, which improves this value as a health indicator.

Regards,
Peter Arrenbrecht
Opus Software AG
Nov 12 '05 #1
1 1881
In v8 CALL is a compiled statement, and we no longer require a table
scan per call.

Peter Arrenbrecht Opus wrote:
Hello IBM

I think that one could improve the performance of DB2 UDB v7.2's
stored procedure resolution. Here's what DB2 normally does:

SELECT A.PROCSCHEMA, A.PROCNAME, A.PARMNAME, A.TYPESCHEMA, A.TYPENAME,
A.LENGTH,
A.SCALE, A.PARM_MODE, A.ORDINAL, A.CODEPAGE FROM "SYSIBM".SYSPROCPARMS
A,
"SYSIBM".SYSPROCEDURES B WHERE A.PROCSCHEMA = 'UMBNT'AND A.PROCNAME =
'GETBYNAME_NUMBERCYCLE' AND A.SPECIFICNAME = B.SPECIFICNAME AND
A.PROCSCHEMA =
B.PROCSCHEMA AND B.PARM_COUNT = 2 ORDER BY 1, 2, 9

If you explain this statement, however, you will see that it results
in a scan of the table SYSPROCPARMS. Simply rephrasing the query as
follows will eliminate the scan (note how the name now restricts
SYSPROCEDURES so the index is used):

SELECT
B.PROCSCHEMA
, B.PROCNAME
, A.PARMNAME
, A.TYPESCHEMA
, A.TYPENAME
, A.LENGTH
, A.SCALE
, A.PARM_MODE
, A.ORDINAL
, A.CODEPAGE
FROM "SYSIBM".SYSPROCPARMS A
, "SYSIBM".SYSPROCEDURES B
WHERE B.PROCSCHEMA = 'UMBNT'
AND B.PROCNAME = 'GETBYNAME_NUMBERCYCLE'
AND A.SPECIFICNAME = B.SPECIFICNAME
AND A.PROCSCHEMA = B.PROCSCHEMA
AND B.PARM_COUNT = 2
ORDER BY 1, 2, 9

While on most systems, the actual performance improvement will be
negligible, it does matter on systems with lots of procedures.

It also does not artificially degrade the ratio of rows read vs rows
selected, which improves this value as a health indicator.

Regards,
Peter Arrenbrecht
Opus Software AG

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bruce Hendry | last post by:
In a nutshell, I have a stored proc that takes appx 15 minutes when it uses a read-only database, and about 2 minutes when the database is not read-only. Details: SQL Server 7 The stored...
8
by: Jack | last post by:
I have a test database that I have built in a 3 partition (and 3 node) environment. I have defined all the tables so they have the same partition key. The tables (7 of them) form a hierarchical...
6
by: AC Slater | last post by:
Hi All, Out of nowhere my udb system (v8) performance has went terrible. Its gotten about 10x worse, (some tests that used to take 2 seconds to run now take 20)... I'm not sure what happened. ...
3
by: Peter Arrenbrecht | last post by:
Hi all I while ago I posted a suggestion to the DB2 newsgroup: ...
9
by: wdwedw | last post by:
I have included all the source codes in the attached MyTest.zip (http://www.codeguru.com/forum/attachment.php?attachmentid=11218) There are three projects: VBTestCOM project is a apartment...
10
by: db2udbgirl | last post by:
I have coded a stored procedure which is planned to run only once in production to process historic data from DB2 8.2 database. It accesses data from a partitioned table and based on some...
6
by: teddysnips | last post by:
In a system I'm maintaining there is a Stored Procedure called dbo.MyStoredProcedure. I didn't create this - it was created by a developer who has now left. I don't know how the object came by...
0
by: ravindrag | last post by:
Hi, I am getting error SQL1131N during sqlj.install_jar(...). There is no useful message in the diag.log (even with diag level 4). I am giving the diag.log entries at the end of this posting...
0
by: mirandacascade | last post by:
Questions toward the bottom of the post. Situation is this: 1) Access 97 2) SQL Server 2000 3) The Access app: a) sets up pass-thru query b) .SQL property of querydef is a string, the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.