All Forums Database
agnitc 9 posts Joined 11/14
27 Dec 2014
GTT vs VT

When do we choose a global temporary table over volatile table or vise-versa?

VandeBergB 182 posts Joined 09/06
27 Dec 2014

The DDL that defines GTTs remains in the data dictionary.  This aspect of GTTs can save you system resources and dbc calls.  Everytime you create a volatile table, there are calls to the dbc tables.  If you're going to reuse the object on a recurring basis, opt for the GTT.  It will be less expensive in the long run.
If it's a one off proposition, use a volatile table.

Some drink from the fountain of knowledge, others just gargle.

agnitc 9 posts Joined 11/14
27 Dec 2014

I thought for volatile tables there are no data dictionary involvement at all. So why is there a need for calls to DBC tables? Can you please explain?

Raja_KT 1246 posts Joined 07/09
28 Dec 2014

This link can help you perchance:
http://www.info.teradata.com/htmlpubs/DB_TTU_14_00/index.html#page/Database_Management/B035_1093_111A/ch02.021.17.html#ww600825

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

VandeBergB 182 posts Joined 09/06
28 Dec 2014

The DB has to build the volatile table, that means interpreting the ddl and building the table, which is already done if you're using a GTT

Some drink from the fountain of knowledge, others just gargle.

You must sign in to leave a comment.