Collect Stats on Global Temporary Table

Database
Highlighted
Enthusiast

Collect Stats on Global Temporary Table

Hi All,

According to manuals, we can collect statistics on global Temporary table.
I tried collecting statistics on an materialized/populated Gloabal Temporary table, But Teradata is throwing the following error message
5343:This statement is not allowed when the target temporary table is already materialized.

I wanted to know, how can we collect stats on a populated Temorary table; If we cannot what is the use of collectinig stats on an empty Temporary table

Thanks in Advance


2 REPLIES
Supporter

Re: Collect Stats on Global Temporary Table

Hi Manne,

Messages
Chapter 6: Teradata Database Messages
5000-Series Messages

"5343 This statement is not allowed when the
target temporary table is already materialized.
Explanation: The user cannot submit any statement
that changes the definition of a base temporary table
when there is a materialized instance of that base temporary
table either locally in the current session or in
any other sessions.
Generated By: RES modules.
For Whom: End User.
Remedy: Wait until the target table is not referenced
by any session then resubmit the request."


If you submit a "collect stats" without the keyword temporary, then it's on the base table.
When it's materialized you can recollect by simply submitting "collect stats on temporary my_table".

If you want to collect on your materialized version use "collect stats on temporary my_table column xy".

Dieter

Re: Collect Stats on Global Temporary Table

Yes Dieter I agree that above stetement what you mentioned like "collect stats on temporary my_table".


but let me know any alternate way to collect stats on the table with out using the above statement like "collect stats on temporary my_table".


Thanks in advance Dieter