Skip to main content

how analyze statistics managed

  • August 24, 2016
  • 3 replies
  • 17 views

Tank

i see analyze statistics on local temp table is supported in document.

will the statistic data purged while close the session which create the temp table?

 

the temp table is about 1M rows, created in a job whih called 1000 times a day. and data in the temp table is not static.

3 replies

Sam37
Forum|alt.badge.img+1
  • Participating Frequently
  • August 24, 2016

You need to use ON COMMIT PRESERVE ROWS option while creating the TEMP table. If the data is getting lost while you come out of the session, stats will also be lost.


Tank
  • Author
  • New Participant
  • August 24, 2016
That`s right, Can you provide any query that i can see the statistics data has gone after the session closed.

Adrian_Oprea_1
Forum|alt.badge.img+1
  • Participating Frequently
  • August 25, 2016

Hi, 

 

The stats are only avilable in the running session for the local temp tbl.

To see the stats status use this query:

select projection_schema,anchor_table_name,projection_name,has_statistics 
from projections where anchor_table_name='temp_tbl_name';

If you drop the tbl / close the session no data will be returned by the statistics query.