\timing on

BEGIN;

set work_mem='100MB';
set maintenance_work_mem='100MB';

CREATE TABLE mybloat (
  myid   int,
  name   text
);

INSERT INTO mybloat (myid, name)
   SELECT a, a::text FROM generate_series(1,10000000) AS a;

ALTER TABLE mybloat ADD CONSTRAINT myid_pkey PRIMARY KEY (myid);
DELETE FROM mybloat WHERE RANDOM() < 0.9;

ANALYZE mybloat;

select attname, correlation from pg_stats where tablename='mybloat';

cluster verbose mybloat using myid_pkey;

drop table mybloat;

COMMIT;
