3 ms·
+1 on that. Handling relationships like parent.child.other_children when writing your own SQL is not trivial at all.
by thworp 3y ago
+1 on that. Handling relationships like parent.child.other_children when writing your own SQL is not trivial at all.
- BiteCode_dev 3y agoIt's so nice to use, espacially in a shell. And also such a performance trap.
- winrid 3y agoYeah, but once it's a performance issue you're making $$$ and you can add some indexes or write a little SQL in the few places that need it :P
- winrid 3y agoAlso child.parents[0].user.username :)
- ttfkam 3y agoTwo join clauses in a statement is not trivial? We apparently have different definitions for "trivial". But if you want hierarchy (in Postgres), to_jsonb(…) is your friend.
- winrid 3y agoIt's much, much slower productivity wise than using the orm. Like 10x slower. Why TF would I use json? There's a reason I picked a relational database. Nonsense.