1

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 ?

1 Answer 1

1

This index does it :

CREATE INDEX my_idx on my_table USING GIN (my_jsonb_column);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.