3 ms·
Wait, why does every query fragment need to compose with every other? What are the N and Ms here?
by jayd16 3y ago
Wait, why does every query fragment need to compose with every other? What are the N and Ms here?
- Spivak 3y agoSay you create a nice little utility function that makes a call to the db func1 and you write func2 that also makes a db query. If you have a func3 that needs func1 and func2 conceptually your options are: * Accept that this will just be two trips to the DB. * Write a new function func12 that writes a query to return all the needed data in one query and use that instead. * Have your tool be able to automatically compose the queries. If you do with the second option you have to do that with every combination of functions that end up being used together which is multiplicative in general.
- jayd16 3y agoWell sure but that not necessary for every combination of every call. Most likely those types of combinations are rare.