test=# CREATE TABLE t1 ( a int, b int ); INSERT INTO t1 SELECT i/100, i/500 FROM generate_series(1, 1000000) s(i); ANALYZE t1;