3 ms·
We had that too. Partial expression indexes mitigated most of the performance problems and CPU load. We then created consistently-named functions that made the
by ttfkam 3y ago
We had that too. Partial expression indexes mitigated most of the performance problems and CPU load.
We then created consistently-named functions that made the appropriate JSON query. Then an expression index on the function. If the key was missing (NULL result), it wasn't added to the index, and we stripped all JSON nulls before storing.
It wasn't necessarily pretty, but neither was the client's source data, which we had little to no control over. Best of a bad situation.
Jsonb columns required more steps afforded us more flexibility and timeliness when the client kept asking for "one more feature" at the last minute.