jsonb - Get all JSON keys efficiently on PostgreSQL -
having table
create table tbl(data jsonb)
i can select keys match pattern object in data
column using
select keys.key ( select distinct jsonb_object_keys(data) key tbl ) keys keys.key ~ '^fc_[a-z]+$'
while gives me desired results pretty slow large number of columns large objects in data column. have not been able find way of creating index on jsonb keys, except via materialized view. there solution give me better performance without overhead?
Comments
Post a Comment