Yet it’s the sysadmin who gets blamed, not the developer. “How can you tune the database so this doesn’t happen?”
I am telling you this because hopefully it will make you feel a little better. Our head of it blames devs for slow queries.
In my 30 years of experience, it is usually the devs.
As a dev, yes usually. It is certainly the better starting point.
Devs who don’t understand how SQL or relational databases work write absolute abortions of queries.
9 times out of 10 - yes it is absolutely the devs. I say that as the dev who gets tasked with analysing why these shitty queries from our low budget outsourced labour are so slow
So you are saying you are the expert in unshitifying queries? What is the most common thing that needs to be unshitified?
Err, no? At what point did I claim to be an expert?
It doesn’t take a genius to realise that serving 100-record chunks of a billion record dataset using
limit 100 offset 582760200
is never gonna perform wellOr that converting indexed time columns to strings and doing string comparisons on them makes every query perform an entire table scan, which is obvious if you actually take the time to look at the query plan (spoiler: they don’t)
“Why can’t the system handle more than 2 queries per second? This database sucks”
I didn’t mean it so serious. I just tried to express that you seem to have experience with it and I am wondering what you have to deal with. I am sorry if it came across negatively.
Allergic to Indices? If your database is slow just add more Indices until you have one on every column of every table! :-)
Hi I need to add some data to the database.
No you fucking don’t
The guy after him:
“Hmm since I don’t feel like looking in the documentation for every possible key of this attribute, I’ll just throw a
distinct
. And while I’m at it, let’s do this for every attribute that I don’t know the keys of”So the guy died and decomposed in 10 minutes and somehow it mysql’s fault?
Poor guy got sigkill-ed, but MySQL keeps going with the request
10 minutes for a process is essentially infinity