drop table gin_test_tbl;

SELECT setseed(.43);

create table gin_test_tbl(i int4[]) with (autovacuum_enabled = off);

insert into gin_test_tbl select array[random()*100000, random()*1000, g] from generate_series(1, 2000000) g;

select pg_current_wal_lsn();

create index gin_test_idx on gin_test_tbl using gin (i)
  with (fastupdate = on, gin_pending_list_limit = 4096);

select pg_current_wal_lsn();

select pg_relation_size('gin_test_idx');
select pg_size_pretty(pg_relation_size('gin_test_idx'));


/*
 pg_relation_size 
------------------
         136839168

master
 pg_wal_lsn_diff 
-----------------------
              352823800

patched
 pg_wal_lsn_diff 
-----------------------
              69509432

*/
