470,815 Members | 1,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

Some questions on Declared Global Temp. Tables

Hi Folks,

1) Why do we have to commit so that statistics are taken into account :

Insert into DGTT
call ADMIN_CMD ('runstats ...')
<<- If we don't commit here, explain plans show that stats are not taken
into account for the following select.
select * from DGTT where ....

Is that correct ? If so, this always implies to have DGTT with on DELETE
PRESERVE ROWS.

2) Why can't we issue an ALTER TABLE ... VOLATILE on such tables ?

We used to do it for Not Logged Initially tables, and switching to DGTT
seems to imply "you'd better run stats".

Thanks for your help,

JM
Nov 12 '05 #1
2 1441
Jean,

1) Documentation states that after running RUNSTATS command "A COMMIT
should be issued to release the locks". The COMMIT is also required to
apply changes to system tables (SYSCOLUMNS, SYSTABLES, SYSCOLDIST).
Issuing a rollback is like canceling collection of the statistics.

The rest is a consequence of that.

2) I'm curious if temporary tables are optimized in the same way as
normal ones (I think not)? Would be nice to have an answer from the
lab, but I guess that VOLATILE is taken into account by default (as it
is temoprary table = table with volatile data).

Greetings, Artur

Nov 12 '05 #2
Artur wrote:
Jean,

1) Documentation states that after running RUNSTATS command "A COMMIT
should be issued to release the locks". The COMMIT is also required to
apply changes to system tables (SYSCOLUMNS, SYSTABLES, SYSCOLDIST).
Issuing a rollback is like canceling collection of the statistics.

The rest is a consequence of that.

2) I'm curious if temporary tables are optimized in the same way as
normal ones (I think not)? Would be nice to have an answer from the
lab, but I guess that VOLATILE is taken into account by default (as it
is temoprary table = table with volatile data).

The table is not considered volatile. The table is defined as APPEND ONLY.

There are thoughts to support ALTER TABLE VOLATILE...

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Billy Cormic | last post: by
5 posts views Thread by Obantec Support | last post: by
6 posts views Thread by an0011 | last post: by
2 posts views Thread by db2admin | last post: by
2 posts views Thread by stefan.albert | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.