-
Global Tempoary tables
Hi. We have a new OLTP database that uses Permanent and Global Temporary tables. We are using the cost based optimizer. We are experiencing performance problems. Do we need to compute stats on temporary tables? Are temporary tables handled differently by the optimizer? Please help. Thanks
-
have you actually worked out what the performance problems are, or are you just guessing
-
Hi. Sorry. I should have been more specific.
We are using the DBMS package to compute stats on the entire schema. We found that the application has been experiencing performance problems. As soon as we delete statistics on the global temporary tables, the performance improves. This is the general feedback that we are geting our users.
We will turn on tracing to get a clearer understanding on what is going on. In the meantime, I was just wondering whether Global Tempoary tables needed stats.
-
You can set statistics on them, but because their contents are likely to change so often it is unlikely that analyzing them on some regular schedule is going to help
-
What's your oracle release?
f it's 9i/10g, Set the optimizer_dynamic_sampling parameter value to 4 or 5.
Trace the sql and examine the access paths.
Another option is:
Create a table of the structure of GTT, load data, gather statistics for the new table. Then export the statistics into a table. There is one column (i think c1) that stores the table name, update this column on the stat table with original GTT name. Then import the stats back into dictionary.
This fixed perf issue.
Tamil