3 ms·
How would you describe what "belongs" in a proper column? Not just anything that doesn't have a uniform schema?
by jrochkind1 5y ago
How would you describe what "belongs" in a proper column? Not just anything that doesn't have a uniform schema?
- bob1029 5y agoFor us, a "proper" column is usually something we want to index against. Things like timestamps, user ids, etc. Anything that would be useful for top-level management of whatever has the json tacked onto it.
- conradev 5y agoYou could pull those out and index them using generated columns, though. That can make things a lot easier on the application side, where the code just needs to insert the JSON blob
- jrochkind1 5y agoYou don't even have to "pull those out and index them using generated columns" to index with postgres jsonb, although it's a bit more confusing to figure out the proper index and make sure your queries hit it, jsonb data is indexable on it's own.