4 ms·
There are sometimes reasons why you don't want to join, such as large data parent row sizes that get repeated a lot in if there's a lot of child relations. But
by kbenson 7y ago
There are sometimes reasons why you don't want to join, such as large data parent row sizes that get repeated a lot in if there's a lot of child relations.
But that should be two queries. One for all the parents, and one to get the children with a sub-select (or at worst a manually generated parent id list), and then you can join them manually (if actually needed and you can't just use the data sets as they are).
- somurzakov 7y agoyou are right, APIs often use o(n) algorithms in an individual API call that is meant to execute once. what happens, is that API users start executing that endpoint N times and here it becomes O(n^2). people should remember that APIs are for CRUD calls. If you want batch reports - call a separate reporting endpoints that process data in large batches.