analyze_statistics vs analyze_histogram
sreeblr
- Select Field - Employee
After loading a table with significant volume >50 % the recommendation as per vertica manuals is to run analyze_statistics which take 10 pct sample. Is this enough or should we run analyze_histogram. What should be ideal sample percent (1-100) ? Also does vertica automatically run analyze_statistics after purge /delete or on any other trigger?
0
Comments
Pretty sure analyze_histogram has been deprecated and analyze_statistics has been updated. I'll take a look at the docs and see what I can find.
So, not exactly deprecated, but take a look and you decide.
https://my.vertica.com/docs/8.1.x/HTML/index.htm#Authoring/SQLReferenceManual/Functions/VerticaFunctions/ANALYZE_STATISTICS.htm?Highlight=analyze_statistics
we are using vertica 7.1 hence using analyze_histogram
Analyze_statistics should suffice and to you question "does vertica automatically run analyze_statistics after purge /delete or on any other trigger" , answer is no. You have to issue analyze_statistics, if there are significant changes.
Analyze_Statistics and Analyze_Histogram do the exact same thing except Analyze_Histogram gave you the ability of changing the fixed 10% to any other percentage in Versions through 7.2. After 7.2, Analyze_Statistics has the percent option. And as @skamat mentioned above, you should be fine with Analyze_Statistics and no it does not automatically run, you must instruct Vertica to run it. It is recommended you run it any time your data has changed significantly as you mentioned.