Quickly tested like this: create table t(a jsonb);insert into t select jsonb_object( array[(random() * 10)::int::text], '{" "}') from generate_series(1, 100000); insert into t select jsonb_object( array[(random() * 10)::int::text], array[(random() * 1000)::int::text]) from generate_series(1, 100000);
explain analyze select * from t where a ? '1'; analyze t; explain analyze select * from t where a ? '1';
Best, Alex