Re: Less-silly selectivity for JSONB matching operators

Alexey Bashtanov <bashtanov@imap.cc>

From: Alexey Bashtanov <bashtanov@imap.cc>
To: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2020-03-31T16:08:26Z
Lists: pgsql-hackers
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



Commits

  1. Improve selectivity estimation for assorted match-style operators.

  2. Implement operator class parameters