So I'm building a table/database in Postgres using its JSONB feature. My question is about how to structure the table/query against it. Is it faster to include a separate relational column featuring a foreign key relating to something like users? Or just store a user in the JSON data and include that in your JSON query.
An example:
| userID | json |
| 1 | { 'userID': 1, |
| | 'something': 5 } |
Or simply:
| json |
| { 'userID': 1, |
| 'something': 5 } |