Effectively searching through entire 1 level nested JSONB in Postgres
问题 Let's say we need to check if a jsonb column contains a particular value matching by a substring in any of the value (non-nested, only first level). How does one effectively optimize a query to search entire JSONB column (this means every key) for a value? Is there some good alternative to doing ILIKE %val% on jsonb datatype casted to text? jsonb_each_text(jsonb_column) ILIKE '%val%' As an example consider this data: SELECT '{ "col1": "somevalue", "col2": 5.5, "col3": 2016-01-01, "col4":