2 ms·
The “dead tree edition.” Good play, sirs. I’m going have to get that one though. I can’t seem to focus/finish when reading educational books on my kindle or i
by odammit 9y ago
The “dead tree edition.” Good play, sirs.
I’m going have to get that one though. I can’t seem to focus/finish when reading educational books on my kindle or in PDF form.
I like the “turn thousands of lines of code into queries”... I can’t count the number of times I’ve seen application code doing something a query could do either to appease an ORM or because a backend engineer wasn’t fluent in intermediate SQL.
- brootstrap 9y agoYeah... i'm totally guilty of abusing the 'python can do it' hammer instead of leveraging the DB. Just last week i looked at an old snippet of code that was essentially a 'query data, load in python, process, shove back in postgres' workflow. I was like, AHA i know better. spent 15 mins figuring out how do accomplish the same thing in the database. Now that shitty code is gone, replaced with 1 SQL statement that runs in seconds, compared to tens of minutes!
- odammit 9y agoIt feels good! I had a rails/ar based report that I "fixed" at my last job that when it ran it generated 1100 reads (not even N+1, a lot of other crazy aggregates, etc). It was complicated, but I got it into one query, subquery and a partition. Went from 45s of app time to process to a <1s query!