this post was submitted on 02 Mar 2024
397 points (96.3% liked)

Programmer Humor

32473 readers
621 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 34 comments
sorted by: hot top controversial new old
[–] [email protected] 35 points 8 months ago (4 children)

Yet it's the sysadmin who gets blamed, not the developer. "How can you tune the database so this doesn't happen?"

[–] [email protected] 21 points 8 months ago (2 children)

I am telling you this because hopefully it will make you feel a little better. Our head of it blames devs for slow queries.

[–] [email protected] 8 points 8 months ago (1 children)

In my 30 years of experience, it is usually the devs.

[–] [email protected] 4 points 8 months ago

As a dev, yes usually. It is certainly the better starting point.

[–] [email protected] 3 points 8 months ago (1 children)

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

[–] [email protected] 4 points 8 months ago (1 children)

So you are saying you are the expert in unshitifying queries? What is the most common thing that needs to be unshitified?

[–] [email protected] 4 points 8 months ago (1 children)

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 well

Or 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"

[–] [email protected] 3 points 8 months ago

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.

[–] [email protected] 8 points 8 months ago

I'm the sysadmin (and transitioning to DevOps) at work, but the DBs are 100% in control of our two devs (one of which being the head of IT).

Apparently we're going to hire a third Dev, who will moonlight as our DBA -- oh, and for 30K/yr.

I'm sure this will go well.

[–] [email protected] 5 points 8 months ago

Infinitely this, biggest pet peeve

[–] [email protected] 5 points 8 months ago

At my job, it's almost always the dev team that is called first for bad DB performance (not always, because sometimes it is the server that's borked).

[–] [email protected] 30 points 8 months ago (3 children)

So the guy died and decomposed in 10 minutes and somehow it mysql's fault?

[–] [email protected] 28 points 8 months ago

Poor guy got sigkill-ed, but MySQL keeps going with the request

[–] [email protected] 20 points 8 months ago

10 minutes for a process is essentially infinity

[–] [email protected] 10 points 8 months ago

Very big table, complex operations, much waiting, so yeah.

In this comic, bodily decomposition occurs at a "feels like" pace:-).

[–] [email protected] 23 points 8 months ago (2 children)

Allergic to Indices? If your database is slow just add more Indices until you have one on every column of every table! :-)

[–] [email protected] 16 points 8 months ago

Hi I need to add some data to the database.

No you fucking don't

[–] [email protected] 2 points 8 months ago

Sounds too good to be true.

[–] [email protected] 11 points 8 months ago

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"

[–] [email protected] 10 points 8 months ago (2 children)

This is fake the pid of the younger guy is smaller than that of grandpa

[–] [email protected] 6 points 8 months ago (1 children)

Their age is measured in CPU time

[–] [email protected] 1 points 8 months ago

and their niceness increases with age

[–] [email protected] 2 points 8 months ago* (last edited 8 months ago)

Could be an instance of BSD where (so I hear) PIDs are assigned randomly from the unused numbers, or else the system has massive process churn going on elsewhere and the old timer is from a previous cycle of consecutive PIDs.

Some systems still have /proc/sys/kernel/pid_max set to something around 32768, so wrapping back to 0 can happen fairly often.

Given all the PIDs in the comic seem pretty low, it might even be as low as 1024 wherever this is.

(Yes, I know I'm taking this way too seriously.)

[–] [email protected] 10 points 8 months ago (2 children)

Is this a MySQL specific problem? I have witnessed a few dead queries on Sybase / Oracle / etc

[–] [email protected] 8 points 8 months ago* (last edited 8 months ago) (3 children)

I don’t think its mysql specifically, but for some reason the worst systems I have used, all have mysql/mariadb as a database.

It seems shitty applications gravitate to mysql, use it poorly, then bring a bad name to mysql.

But given all my years of experience with it, MSSQL > Posgresql > Mysql > Oracle

[–] [email protected] 4 points 8 months ago* (last edited 8 months ago)

I feel like the popularity of the LAMP stack (or WAMP if you were just starting out your interest in software and hadn't yet moved to Linux) in the 00s and early 10s is to blame here. MySQL ended up being the default choice for people who didn't know much about databases.

Now that I know more than I did at the age of 14 when I first started learning programming... I'll be honest, I'm still likely to choose MySQL just because it's familiar. But at least I know what indices are now, and I try to avoid dependent subqueries :)

To be fair, I feel like I should use Postgresql more, I just haven't actually ever worked on anything that needed the cool data types it has extensions for.

[–] [email protected] 2 points 8 months ago

Databases need tuning for your workload, and most people just think it’s a big box where you can dump anything you want and it will work. And then when it chokes on a terrible query they blame the DBA.

This makes DBAs very cranky.

[–] [email protected] 2 points 8 months ago

I was a DBA for over 10 years. Postgresql is superior to mssql in most ways. Especially replication.

But that does not mean that mssql is bad. MySQL is, oracle is.

[–] [email protected] 3 points 8 months ago

Usually DBMSs have some small capacity to handle requests in parallel so everything slows down, but work is still getting done.

[–] [email protected] 9 points 8 months ago (1 children)

How come people use sql instead of just using text files? I just use text files for everything

[–] [email protected] 7 points 8 months ago* (last edited 8 months ago) (1 children)

What are text files if not binary blobs on disk?

What is SQL if not a query layer over a bunch of binary blobs on disk?

[–] [email protected] 4 points 8 months ago
[–] [email protected] 3 points 8 months ago

Using subqueries instead of CTEs, scrubs!

[–] [email protected] 2 points 8 months ago* (last edited 8 months ago)

Why do they wait in line for one guy? It's just a select and there should be multiple employees at the counter, or not?