| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Next » |
|
Rather than a "Wooden Table", this photograph was taken on a WHITEBOARD.
|
|
...
That's insane. captcha: populus - boring game |
|
Probably true.
|
|
Fr1st two words: SELECT ( SELECT. That's already very promising.
Also, not fr1st! |
|
Holy Fuck, no human could write that!
|
|
I don't get it. So much crap posted on The Daily WTF is for initiates only with no explanations for those of us with over 20 years programming experience who lack that finite bit of knowledge that makes YOUR WTF understandable.
|
Re: The Query of Despair
2011-10-24 09:13
•
by
Nagesh
(unregistered)
|
You are being corect: this is most likly Hibarnate. |
|
Looking at that image gave me a similar feeling to watching VanDamme dancing in the movie Kickboxer.
|
|
I've already seen a ten-page-long query. And it was used in a real application.
Thankfully, I've never had to debug it. |
|
Why not tidysql the query instead of printing it out unreadable? (or printing it out at all)
|
What, nausea? |
Re: The Query of Despair
2011-10-24 09:16
•
by
trollsolo
(unregistered)
|
|
I've seen many things do this. Use a beautifier. Sure it'll use more paper, but stable it together and it's worth it.
|
Because it would have made it longer. |
|
I feel for the his colleague.
|
|
The problem is on page 4, line 27. Isn't that obvious to everyone?
|
|
The worst part is I looked at that query and was like, oh hibernate probably generated that query. Then I looked again and from what I can see it doesn't look like it's aliasing tables/fields the way that hibernate would. This leads me to believe that someone probably wrote this...
|
I think the colloquial term is "douche chills". |
|
Seen a query of this size that was generated by an alien logic that my colleague wrote... and strangely enough, it was the only possible way to get the desired result as the DB structure was just as alien.
|
Re: The Query of Despair
2011-10-24 09:26
•
by
trtrwtf
(unregistered)
|
I'm feeling like I know more about frits than I want to know right now. I'm off to have a shower. |
Re: The Query of Despair
2011-10-24 09:28
•
by
Steve The Cynic
|
Well, I have over 20 years' programming experience, and evidently I have the necessary piece of knowledge. In fact, it's in the article. The picture shows a hard-copy of *one* SQL query. HTF does an SQL query get complex enough to be spread over six pages? |
That's more than I wanted to know about your relationship with frits... |
I totally forgot about that scene. Thanks for undoing hundreds of hours of therapy frits... |
Re: The Query of Despair
2011-10-24 09:33
•
by
kjordan
(unregistered)
|
I'm not even sure what kind of query you would have hibernate doing that it would do it like that. Hibernate seems to do it less in big queries now, but you might have more running to populate your objects if you don't have lazy loading turned on for relationships. |
Re: The Query of Despair
2011-10-24 09:33
•
by
SuperQuery
(unregistered)
|
|
I've got one. Try being told to pull out info from 245 tables that all need to be related. To create another unassociated, mess of a db with..... :(
Although my is spaced a lot better :) |
If you've had the mispleasure of seeing that scene, no matter how long and far you try to stuff the memory, the pain will always be there. |
Re: The Query of Despair
2011-10-24 09:37
•
by
The poop of DOOM
|
Seriously guys, I haven't seen that movie yet. Could you please put spoiler tags around this? Then again, at least I've been warned now. |
|
Awesome.. the mail reads "The platform is very slow and produces a lot of errors. Could you check this?"
|
|
If this is Orcle, Tomas Kyte can certenly help with it.
|
Re: The Query of Despair
2011-10-24 09:44
•
by
Anon
(unregistered)
|
I'd bet on generating reports that require aggregate functions while not actually using any aggregate functions. My own record in reporting is a page and a half on one SQL-query (unbeautified). 7K of text, optimized the heck out of, to run in under two seconds every few hours. |
|
Oh my god... it's full of stars.
|
Re: The Query of Despair
2011-10-24 09:48
•
by
I. G. E.
(unregistered)
|
I have seen it, and I haven't a clue what scene they may be talking about. In a Van Damme movie, what kind of *censored* even notices anything except the fighting scenes? |
|
http://tinyurl.com/QueryOfDespairReaction
That's the first thing that sprung to mind when I saw that printout. Also, they need a highlighter to make it have some more colour to discern various bits of it. |
I'm sorry that I don't distinguish one type of fiction and choreography from another. |
Re: The Query of Despair
2011-10-24 09:52
•
by
Canthros
(unregistered)
|
Regrettably, my second or third thought was, "I really hope that wasn't one I had to write." After another, closer look, it isn't (I never had to write anything against a schema with Dutch table names). I wound up writing a hideous abomination of an 8+-way union, once. IIRC, it was a bunch of reporting queries that needed to be squished together, so the individual queries weren't terrible, there were just a lot of them. It's also possible that it's a bunch of MS Access queries that have been strung together, which might explain the SELECT (SELECT thing at the start. Access has traditionally had some curiously quaint restrictions on query size that tends to turn any even moderately complex query into a maze of small, twisty queries, all alike. Finally, it could just be that whoever created that thing had no idea what they were up to. |
Re: The Query of Despair
2011-10-24 09:55
•
by
Anon
(unregistered)
|
|
Selffix: aggregate functions = somewhat complex aggregate functions, like AVG .. OVER ... RANGE BETWEEN .. etc.
|
Just remember: what has been seen, cannot be unseen. |
|
There is no hope. The best you can do is put the beast down. Burn the document, wipe the drives, torch the building... Oh, and flush the site with holy water just to be on the safe side.
|
Re: The Query of Despair
2011-10-24 10:01
•
by
Anon
(unregistered)
|
No. Please, just - no. *horrified* |
|
That's pretty bad, but in my experience such queries are usually a result of
1) lack of SQL know-how and 2) extensive CTRL+Cing-and-CTRL+Ving. This massive beast is most likely a handful of copies of several smaller-but-ever-so-slightly-different beasts all JOINed and UNIONed together. Example:
I bet if you format it, it'd take (at most) only a couple months and all your remaining sanity to refactor it into something mentally-parsable. |
Which is exactly why he shouldn't try to RE the bitch and should just rewrite it from scratch based on specs (HA!) or expected behavior... |
|
Am I the only one here that wishes he (or she) could attempt to clean that up and then refactor it? :D
Inside that ugly mess is some beautiful code, just trying to come out. |
Re: The Query of Despair
2011-10-24 10:11
•
by
Ross
(unregistered)
|
|
Nuke the site from orbit. It's the only way to be sure.
|
Re: The Query of Despair
2011-10-24 10:12
•
by
Canthros
(unregistered)
|
I think I'm wrong about that, anyway. Looks like the beginning is caused by the first column being an aggregate (count) in a correlated subquery against a different table. But, yeah. When I was decoding Access queries, many oaths were sworn and curses invoked. |
|
Just out of sheer curiosity, I really wish to see this query in full.
|
|
Obligatory grammar snark:
"I don't think anyone can help me," the his colleague wrote. CHOOSE ONE OR THE OTHER ALEX. |
Re: The Query of Despair
2011-10-24 10:28
•
by
trtrwtf
(unregistered)
|
As a wise man once said, "Just remember: what has been seen, cannot be unseen." |
|
On the plus side (for Jeroen's colleague), since this SQL was submitted as a CodeSOD instead of a Representative Line, I assume it implies some semblance of sanity in the rest of the source.
|
Re: The Query of Despair
2011-10-24 10:30
•
by
trtrwtf
(unregistered)
|
There's only one Alex writing this, grammar boy. (I gots to keep up my grammar Nazi rep, yo) |
|
I once helped out on a project with a SQL query that long that took 70 seconds to complete on average (not good for a web app!). I fixed it by extracting the relevant data from the database and doing the search in RAM, reducing the query time to sub second. Some things are best not done with a relational database.
|
Re: The Query of Despair
2011-10-24 10:30
•
by
The poop of DOOM
|
To apply for Representative Line, it should be a line, not six pages. |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Next » |