473,467 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Statistics with volatile table

>From the IBM db2 docs:
http://publib.boulder.ibm.com/infoce...n/t0005308.htm

it says that volatile tables (ALTER TABLE mytable VOLATILE
CARDINALITY) do not use statistics. I would just like to clarify this
statement. Does this mean that no statistics at all are used when
determining the execution plan? or does this mean that statistics
applying to cardinality are not used when calculating the execution
plan?

If this means that no statistics at all are used when the optimizer
decided the execution plan is it possible for the optimizer to choose
an incorrect index for a query? i.e How safe is setting a table to
have volatile cardinality?

Jun 28 '07 #1
3 8723
On Jun 28, 11:35 am, Otto Carl Marte <Otto.Ma...@gmail.comwrote:
From the IBM db2 docs:

http://publib.boulder.ibm.com/infoce...x.jsp?topic=/c...

it says that volatile tables (ALTER TABLE mytable VOLATILE
CARDINALITY) do not use statistics. I would just like to clarify this
statement. Does this mean that no statistics at all are used when
determining the execution plan? or does this mean that statistics
applying to cardinality are not used when calculating the execution
plan?

If this means that no statistics at all are used when the optimizer
decided the execution plan is it possible for the optimizer to choose
an incorrect index for a query? i.e How safe is setting a table to
have volatile cardinality?
No statistics are used. The optimizer uses index scan Only if all
referenced columns are in the index else it's table scan.
We use volatile on a couple of tables due to extreme card
changability. The case we had was at the time of runstats the card was
0 and so the access is table scan but the cards increased to a million
and it still used table scan. Changing to volatile worked fine as it
did index scan.

Jun 28 '07 #2
Thanks, that is exactly the case (empty table that increases to a
large table) we want to use volatile tables for. The concern we have
is that for some tables with multiple indices the incorrect index will
be used. I suppose what you are saying is that we should be careful to
ensure we have correct indices for our queries when using a volatile
table. But then again, you always have to be careful to have the
correct indices for large tables :-)

Jun 29 '07 #3
Comments from backstage:
Volatile tables should be used if the tables are truly volatile when the
tables grow and shrink dramatically and unpredictably so that RUNSTATS
at any given time could be misleading. If there are some statistics on
the table, they may be used in conjunction with some on-the-fly
statistics fabrication that is not easy to describe.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 29 '07 #4

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

Similar topics

4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
3
by: Metal Dave | last post by:
Hello, A script we run against the database as part of the upgrade of our product is failing with the following message: ALTER TABLE ALTER COLUMN EncodedID failed because STATISTICS hind_61_3...
2
by: Lyn Duong | last post by:
Hi, I have a job that performs a runstats on tables in my database (db2 V8 on AIX) and the syntax is db2 runstats on table schema.tabname with distribution and detailed indexes all. when I...
4
by: serge | last post by:
I am running a query in SQL 2000 SP4, Windows 2000 Server that is not being shared with any other users or any sql connections users. The db involves a lot of tables, JOINs, LEFT JOINs, UNIONS...
0
by: Bucker | last post by:
Could someone view the following that I copied from phpMyAdmin and tell me from the statistics if are server is running OK? Does it look like we will have problems as more people hit our server?...
2
by: Ralf | last post by:
Hi, is it possible to programmatically update table statistics by executing SQL-statements via Jdbc-driver? My DB-application fills an initially empty table with a huge number of rows and I try...
0
ADezii
by: ADezii | last post by:
In last week's Tip, I showed you how to use the ISAMStats Method of the DBEngine (DAO) to return vital statistics concerning Query executions such as: Disk Reads and Writes, Cache Reads and Writes,...
3
by: Justin | last post by:
Is there a way to remove / clear / drop statistics for a single table?
10
by: w.l.fischer | last post by:
Is it possible to have statistics on temporary tables? I frequently put 10000 or more rows in a temporary table and would like to know it the queries become faster with statistics on those tables.
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.