Is clustering factor stored in pg_stats.correlation?

Поиск
Список
Период
Сортировка
От AlexK987
Тема Is clustering factor stored in pg_stats.correlation?
Дата
Msg-id 1419116343364-5831610.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: Is clustering factor stored in pg_stats.correlation?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: AlexK987
Дата:
Сообщение: Re: How to connect to postgres.app on Mac from PgAdmin
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is clustering factor stored in pg_stats.correlation?