create table t1 (a int);
insert into t1 select i from generate_series(1,21) s(i);
insert into t1 values (1), (2);
analyze t1;

select most_common_vals, most_common_freqs from pg_stats where tablename = 't1';

create table t2 (a int);
insert into t2 select 22 from generate_series(1,100000) s(i);
insert into t2 select 23 from generate_series(1,100000) s(i);
insert into t2 select 5 from generate_series(1,1000) s(i);
analyze t2;

select most_common_vals, most_common_freqs from pg_stats where tablename = 't2';

explain analyze select * from t1 join t2 using (a);
