Search Postgresql Archives

Is clustering factor stored in pg_stats.correlation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I believe that tables' clustering factors are stored in pg_stats.correlation.
Here is how I came to this conclusion:

create table narrow_table as
with numbers as(
select generate_series as n from generate_series(0,1048575))
select n as seq_number, 
(n/1024) + ((n%1024)<<10) as rand_number 
from numbers;

alter table narrow_table
add constraint pk_narrow_table primary key(seq_number);

alter table narrow_table
add constraint unq_narrow_table unique(rand_number);

cluster narrow_table using pk_narrow_table;

vacuum full analyze narrow_table;

Now my table is physically ordered by its primary key. Apparently the
following query indicates that:

SELECT attname, correlation
FROM pg_stats
WHERE tablename LIKE '%narrow%';

"seq_number";1
"rand_number";0.00665399

Please correct me if I am wrong, or confirm my conclusion.



--
View this message in context: http://postgresql.nabble.com/Is-clustering-factor-stored-in-pg-stats-correlation-tp5831610.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux