3 ms·
I wonder if people do timings for the variances between a function in the DB vs Python? Unless your queries are so small (like individual records) that a round
by bshipp 7y ago
I wonder if people do timings for the variances between a function in the DB vs Python? Unless your queries are so small (like individual records) that a round-trip to the DB is impacted by network lag, I find it's almost always faster to ask the DB to do as much of the lifting as possible.
The downside, of course, is that your code potentially becomes unreadable, harder to migrate between database backends, and more difficult to debug.
- teej 7y agoPushing computation back into the database has been a major trend in the last few years. Tools like DBT have made that transition easy in terms of clean code and testable SQL.