I have a jsonb row with objects/dictionairies : {"a":1, "b":2, "c",3}
I want to query rows that contain a set of keys, ex:
SELECT * from my_table v
WHERE v.my_jsonb_column::jsonb ?| array['b','a']
how can I create an index for this query ?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityThis index does it :
CREATE INDEX my_idx on my_table USING GIN (my_jsonb_column);