Postgresql: query on jsonb column - index doesn't make it quicker
问题 There is a table in Postgresql 9.6 , query on jsonb column is slow compared to a relational table, and adding a GIN index on it doesn't make it quicker. Table: -- create table create table dummy_jsonb ( id serial8, data jsonb, primary key (id) ); -- create index CREATE INDEX dummy_jsonb_data_index ON dummy_jsonb USING gin (data); -- CREATE INDEX dummy_jsonb_data_index ON dummy_jsonb USING gin (data jsonb_path_ops); Generate data: -- generate data, CREATE OR REPLACE FUNCTION dummy_jsonb_gen