\set nstats 10000

alter table tint1 alter column x set statistics :nstats;
alter table tint2 alter column x set statistics :nstats;
alter table ttext1 alter column x set statistics :nstats;
alter table ttext2 alter column x set statistics :nstats;

vacuum analyze tint1, tint2, ttext1, ttext2;

\echo nstats = :nstats
select tablename, array_length(most_common_vals,1)
from pg_stats where tablename in ('tint1', 'tint2', 'ttext1', 'ttext2')
order by 1;

explain select * from tint1 t1 join tint2 t2 on t1.x = t2.x;
explain select * from ttext1 t1 join ttext2 t2 on t1.x = t2.x;
