Analyse SQL Server histogram table -
is there way access histograms values in sql server sql command? easy see histogram of attribute using dbcc show_statistics, however, possible access histogram table in sql select command or in t-sql procedure/function?
i remember trick video of kimberley tripp,so quick search yielded below
create table histogram ( [range_hi_key] sql_variant , [range_rows] sql_variant , [eq_rows] sql_variant , [distinct_range_rows] sql_variant , [avg_range_rows] sql_variant ) insert histogram exec ('dbcc show_statistics(''dbo.orders'',''_wa_sys_00000001_29572725'') histogram')
now can access table ..you can same stat_header , density_vector
Comments
Post a Comment