GTT vs VT

Database
Enthusiast

GTT vs VT

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

Re: GTT vs VT

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.

Enthusiast

Re: GTT vs VT

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?
Enthusiast

Re: GTT vs VT

Enthusiast

Re: GTT vs VT

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