Skip to main content

How to analyze statistics on local temporary tables in vertica

  • Sep 20, 2016 10:21 AM UTC
  • 4 replies
  • 26 views

Vinnu

How to analyze statistics on local temporary tables in vertica ?

Vertica Database Version - 7.2.3

4 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • Sep 21, 2016 4:34 PM UTC

Temporary tables are session scoped. Why do you want to analyze statistics on them?


Aadu
  • New Participant
  • Sep 22, 2016 11:50 AM UTC

Hi Sruthi, 

 

Temporary tables that are getting created are huge in size and are further used in joins in the same session. Un analyzed or no statistics are creating wrong query plans.

 

I can now analyze them. I was passing wrong command to analyze them.


Adrian_Oprea_1
Forum|alt.badge.img+1
  • Participating Frequently
  • Sep 22, 2016 12:04 PM UTC

 Hi ,

 

ANALYZE_STATISTICS is supported on local temporary tables and you must create the table with the option ON COMMIT PRESERVE ROWS.

 

 


Adrian_Oprea_1
Forum|alt.badge.img+1
  • Participating Frequently
  • Sep 22, 2016 12:05 PM UTC

 Make sure you also watch the sort key as well