4 ms·
I'm a huge believer in postgres' json store, but anything above the basic queries can get a bit messy. Lateral joins really clean up aggregate data queries on j
by zaius 12y ago
I'm a huge believer in postgres' json store, but anything above the basic queries can get a bit messy. Lateral joins really clean up aggregate data queries on json columns. E.g.
SELECT id, COUNT(keys)
FROM users,
LATERAL json_object_keys(login_history) keys
GROUP BY id;