2 ms·
That assumes that all of a user's data is a single foreign key relationship away from the user, which often isn't the case. It also requires you to scan the en
by duskwuff 4y ago
That assumes that all of a user's data is a single foreign key relationship away from the user, which often isn't the case.
It also requires you to scan the entire table and decode JSON for every row you've ever deleted, which may become prohibitively expensive for large databases.
- username1407 4y agoThat's true. To give an example for your 1st point: If you have the schema users->messages->message_attachments and message_attachments does not store the user_id, you'll have trouble finding all attachments from a specific user.
- simonw 4y agoPostgreSQL can create indexes on the results of expressions, so it's possible to accelerate queries that select against a nested value inside a JSON blob.