473,395 Members | 1,466 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,395 software developers and data experts.

runstats within open transaction

I want to do runstats within an open transaction to get best optimization
for current distribution but in the past I have recognized that runstats had
no effect on the next Statements within that transaction.
Is this behavior like it should be or could I expect the optimizer to use
the updated but not commited statisticts within this transaction?

Thanks
Klemens

May 11 '06 #1
4 1818
Klemens wrote:
I want to do runstats within an open transaction to get best optimization
for current distribution but in the past I have recognized that runstats had
no effect on the next Statements within that transaction.
Is this behavior like it should be or could I expect the optimizer to use
the updated but not commited statisticts within this transaction?

I think it's more likely that DB2 is re-using cached and compiled
statements. Is this interactive SQL or a procedure?

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 11 '06 #2
This is from clp script with autocommit off.

Thanks
Klemens

"Serge Rielau" <sr*****@ca.ibm.com> schrieb im Newsbeitrag
news:4c*************@individual.net...
Klemens wrote:
I want to do runstats within an open transaction to get best optimization for current distribution but in the past I have recognized that runstats had no effect on the next Statements within that transaction.
Is this behavior like it should be or could I expect the optimizer to use the updated but not commited statisticts within this transaction?

I think it's more likely that DB2 is re-using cached and compiled
statements. Is this interactive SQL or a procedure?

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

May 11 '06 #3
Klemens wrote:
This is from clp script with autocommit off.

Thanks
Klemens

"Serge Rielau" <sr*****@ca.ibm.com> schrieb im Newsbeitrag
news:4c*************@individual.net...
Klemens wrote:
I want to do runstats within an open transaction to get best optimization for current distribution but in the past I have recognized that runstats had no effect on the next Statements within that transaction.
Is this behavior like it should be or could I expect the optimizer to use the updated but not commited statisticts within this transaction?

I think it's more likely that DB2 is re-using cached and compiled
statements. Is this interactive SQL or a procedure?

Just for debugging purposes, after the runstats slightly modify the SQL
statement. E.g.
If you wrote:
SELECT * FROM SYSIBM.SYSDUMMY1
change it to:
SELECT * FROM SYSIBM.SYSDUMMY1
Thsi will make suer you et a new statement.
If that fixes the problem then the cache is your problem.
FLUSH PACKAGE CACHE should do the job then, but keep in mind it's global.
http://publib.boulder.ibm.com/infoce...n/r0007117.htm
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 11 '06 #4
Serge,

I'm just wondering if optimizer can read uncommitted data from system
catalogs?

Runstats in fact need commit, If after runstats rollback is issued, all
the system catalog statistics disappear.
-- Artur Wronski

May 11 '06 #5

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

Similar topics

2
by: M Wells | last post by:
Hi All, This seems like a tricky question to me. I have a Stored Procedure that encapsulates a number of updates to various tables within a transaction. However, at a later part of the...
3
by: Jan Arickx | last post by:
My situation is as follows. I have several big SQL queries in a data warehouse using 1 big fact tables and 10 dimension tables. The queries join all of them together but the optimizer doesn't care...
7
by: Todd McNeill | last post by:
Hi- Something was just pointed out to me this morning. According to the V8 Command Reference, the RUNSTATS command no longer uses the SHRLEVEL CHANGE/REFERENCE clauses, and it looks to be...
4
by: kenfar | last post by:
I've got a large table on db2 8.2.1 that I rarely perform runstats on. It has about 600 million rows organized in a single MDC time dimension on a non-dpf warehouse. Anyhow, we recently ran...
0
by: CJM | last post by:
I have a fairly simple ASP application talking to an Oracle 10g DB using a mixture of ADO (OraOLEDB) and OO4O - the query here concerns some ADO code. One part of the application records...
0
by: RG | last post by:
I have a stored procedure which is called by db2 "call ....." statement from ksh script. When running from AIX DB2 v. 9.1.3 environment, after a while the stored procedure starts to hang and...
4
by: db2udb | last post by:
Hi, I have just taken over as the DBA for a database that has not had any reorgs/runstats run against it for the last three years. As a first step, I have just run reorg/runstats against the system...
7
by: Okonita via DBMonster.com | last post by:
Hi all, I am very surprised to see that after doing a Reorgchk followed by reorg of selected tables and concluding with a runstats of the reorged tables, all of the tables continue to be...
6
by: BobRoyAce | last post by:
Let's say that I am performing a bunch of insert/update queries within a transaction that is created as follows: Dim cnn As New SqlClient.SqlConnection(My.Settings.GRPConnectionString)...
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
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?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.