Considering the below query,

    sub_test df,
    jsonb_array_elements(json_data) jba
    (jba->>'name')::text = 'SubYear'
    and (jba->>'value')::numeric > '2050';

There are about 500+ keys such as "name" as mentioned in the above query in the json_data JSONB type column. I would need to make a comparison against a specific year. Should individual index be created for all the available keys or how to handle such queries to make use of index scan?

Kindly help to clarify.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.