dbTalk Databases Forums  

Re: GLOBAL TEMPORARY table - serious join performance problem

comp.databases.oracle comp.databases.oracle


Discuss Re: GLOBAL TEMPORARY table - serious join performance problem in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Garrison
 
Posts: n/a

Default Re: GLOBAL TEMPORARY table - serious join performance problem - 09-22-2004 , 05:57 PM






Jim Garrison wrote:

Quote:
Scenario:

1) Create a GLOBAL TEMPORARY table and populate it with
one (1) row.

2) Join that table to another with about 1 million rows.
The join condition selects a few hundred rows.
[snip]

I found references to one solution, which is to set the
table statistics (numrows, specifically) manually using
DBMS_STATS.SET_TABLE_STATS. While this works, it appears
that table statistics are shared among all instances.
That is, even though every session gets its own copy of
the data, there's only one copy of the stats. Two
sessions with greatly differing rowcounts will step
on each other's stats. Oh well.... I guess I'm
going to have to go back to real tables.

GTTs don't seem to be fully baked yet, at least in 9i.
Can anyone confirm that GTTs work better in 10g?

Jim Garrison
jhg (AT) athensgroup (DOT) com


Reply With Quote
  #2  
Old   
Jim Garrison
 
Posts: n/a

Default Re: GLOBAL TEMPORARY table - serious join performance problem - 09-23-2004 , 12:33 PM






Jonathan Lewis wrote:

Quote:
Read about dynamic sampling.

Use a level where all tables without
statistics are sampled at run time, and
your problem will go away.
That does the trick.

I added /*+ dynamic_sampling(gtt 1) */ and the query
works FASTER than a real table (about 15% faster)
and the execution plan is logical once again.

One note that should be in the docs is that if the
table has an alias in the statement then only the
alias name can be used in the hint. The full table
name is ignored in that case.

Thanks for your assistance.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.