472,811 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 8656
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.
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.