select * from all_tab_statistics where OWNER = 'TEST' and TABLE_NAME = 'TAB1';
select * from all_ind_statistics where OWNER = 'TEST' and TABLE_NAME = 'TAB1';
select * from all_TAB_COL_STATISTICS where OWNER = 'TEST' and TABLE_NAME = 'TAB1';
select * from all_PART_COL_STATISTICS where OWNER = 'TEST' and TABLE_NAME = 'TAB1';
select * from all_SUBPART_COL_STATISTICS where OWNER = 'TEST' and TABLE_NAME = 'TAB1';
select * from mysql.innodb_table_stats where table_name = 'tab1';
select * from mysql.innodb_index_stats where table_name = 'tab1';
show table status;
show table status like 'tab1'\G
select * from pg_class;
select * from pg_statistic;
select * from pg_stats;
select relname,relpages,reltuples
from pg_class
where relname like 'random_t%';
select tablename,attname,n_distinct,correlation,most_common_vals,most_common_freqs,avg_width
from pg_stats
where tablename = 'tab1';
select object_name(object_id) as object_name, * from sys.stats;
go
select object_name(object_id) as object_name, * from sys.stats_columns;
go
SELECT * FROM sys.dm_db_stats_properties (object_id('dbo.tab1'), 2);
go
SELECT sp.stats_id, name, filter_definition, last_updated, rows, rows_sampled, steps, unfiltered_rows, modification_counter
FROM sys.stats AS stat
CROSS APPLY sys.dm_db_stats_properties(stat.object_id, stat.stats_id) AS sp
WHERE stat.object_id = object_id('tab1');
go
DBCC SHOW_STATISTICS ('test.dbo.tab1','ind11')
SELECT
OBJECT_NAME(dsp.object_id)
, dsp.object_id
, ss.name
, dsp.last_updated
, dsp.rows
, dsp.rows_sampled
, dsp.steps
, dsp.unfiltered_rows
, dsp.modification_counter
FROM
sys.stats AS ss
CROSS APPLY
sys.dm_db_stats_properties(ss.object_id, ss.stats_id) AS dsp
WHERE
OBJECT_SCHEMA_NAME(dsp.object_id, DB_ID()) <> 'sys'
go