News for hackers. Stuff that matters.
Re:For Want of a JOIN by mijoharas on Thursday December 22, 2022 @10:57AM (#34094684)
> I'm not sure I understand how a JOIN would have fixed this problem

If the set of things in A that have ids in B is very small, then very little data is returned from the JOIN query, while a lot may be returned from the B query by itself.

(if that set of things is large, then you'll still want to batch the joined query as well, i.e. using find_each in rails. They're orthogonal requirements)

Re:For Want of a JOIN by nightpool on Thursday December 22, 2022 @02:59PM (#34097832)
Sure, I mentioned this in my comment as well, but I think it's clear from the use-case of the article that the cardinalities of the two tables are approximately the same.