SQL Dumbass

Fighting dumbasses, one query at a time…

63 Billion Rows of Tablescans = Justified Stabbing

Dear SQLDumbass: What should I do if an analyst asks he needs to run 20 instances of an app that does tablescans 19 times against a table with 3.2 billion rows? Should I jump off a cliff for wondering what I did wrong to even meet a dumbass like this or stab him and give in myself to the police? – Mark V

Dear Mark: Stabbing is never the answer. Well, except maybe in this case. But instead of giving yourself in to the police, you should call the DBA Cops instead. I don’t know if they really exist, but if they did I am sure they would just show up, call for the coroner, and let you go with a warning. So, your first step here is to find the phone number for the DBA Cops. I looked but they don’t seem to be listed. And if they don’t exist yet, you should start your own DBA Cop unit. Then you could just arrest the guy for murdering the performance of the server and everyone comes out a winner.

Dear SQLDumbass: We have a developer here that got hired recently who wants to put everything she can find into separate schemas inside of one database. When we pointed out that an easier approach might be to just create a new database for all of the new objects she actually had the balls to chastise our collective 45 years of experience by saying “new databases are a waste of time, we just need new schemas.” We then replied that a schema is essentially a database inside of a database, so she wasn’t saving the world with her approach or anything and she got upset that we are not doing what we are told. So, my question for you today is this: what is the fastest way to make someone you work with disappear? – Jules

Dear Jules: Well, if your coworkers are anything like my dates, they will disappear fairly quickly and you won’t even have to wonder how it happened. Best if you just sit back and let this newbie self-implode, it shouldn’t be long before they are building table valued functions on top of views on top of functions to the point that performance comes to a halt after every five minutes.

Dear SQLDumbass: Why is Oracle so much better than MS SQL? – Jason M.

Dear Jason: I think you meant to ask ‘Why is Oracle so much more expensive than MS SQL’, and the answer is “I don’t know”. I suspect it’s like the time Martha Stewart started charging $20 for her $3 pies, she knew that people would buy them simply because of the perceived value but at the end of the day those people are still going to go home, have a slice for dessert, and get the runs.