- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Are you sure that's Crazy Talk, and not Dummy Speak?
SELECT TOP 10 * FROM ANYTHING that has more than 10 records returns an almost always totally useless set of random rows, since there's no WHERE or ORDER BY specified.
The only reason to use SELECT TOP x is to either return a subset of the data from a query with a WHERE or ORDER BY, where you know there are only a few rows in a table that were added in a specific order (and even this use is questionable, as most RDBMS's don't guarantee any specific order without a statement that indicates what it should be), or using it to get the names of the columns (e.g., SELECT TOP 1 * FROM YourTable WHERE 1 = 0).
Any other use is a WTF, like your post.
Admin
I knew there had to be at least one moron who'd turn this into some kind of MS-bashing.
This is not a platform issue, or an OS issue, or a MS software/OS issue. This is a story about stupid developers, a category which you seem to fit into well since you can't tell the difference.
If you're that short on intelligence, WTF makes you think anyone here would want a suggestion from you?
Admin
While it's possible to have both a DDS and a PhD, the honorific "DDS/DDS-PhD" makes no sense to me at all.
Admin
It's a "Doctor of Dental Philosophy". You know, the sort of person who sits around all day debating whether, if you pull a tooth in the forest, do the fuzzy animals run away from the screaming?
Admin
Man this story caused a WHOLE lotta flashbacks for me.
At one job, we had a similar piece of software. This content management software was bought (by kickbacks to a PHB if the rumors were true). It was a Windows-only product 1st and claimed that it could be used in a distributed Unix environment (traditional server/client w/ an Oracle backend).
This WTF software killed every machine it was installed on! A single user editing and saving content would peg the Unix system so bad that it took ~20 minutes from the time a Return was entered until a command prompt showed up (no commands...just hit enter). We finally resorted to the following:
We had 27 people who needed to use the software to meet content creation goals for the web-site, so we set up 27 Unix boxes and assigned each user a box. The boxes were set for a reboot EVERY hour since the app lasted about that long before it totally killed the box.
Meanwhile, the Oracle server was sitting at ~0.1% load usage, and the network was approximately the same. We finally got a really good snoop of the network traffic, and the guy doing the analysis was sitting there looking like a fish out of water.....just opening a closing his mouth w/ this wild look of fear in his eyes!
It turned out the the original system had NEVER been tested in a distributed form. the original had EVERYTHING (the app and DB on the same machine connecting by clients). This thing was making requsets to the DB and requesting exactly 2 bytes per request....that's right, exactly 1 character of the web page per DB request.
Therefore there were over 140K DB requests going to the DB to generate a single 3K Web page, and that was swamping the client CPU. The oracle server just took the requests w/o even breaking a sweat...probably had the entire thing cached for days before that.
1 year of 2 SW engineers from that company on site and programming on the live production system brought the number of needed machines to 2 content developers per single Unix system. Of course the PHB left the company under questionable reasons before the all-seeing-eyes from accounting found him. And the entire division died pretty quickly after the CEO saw the bills he was paying for this thing.
All in all a pretty impressive con job if I do say so myself
Admin
I hope that you are talking about those without proper education? Anyone with a CS degree should know about WHERE-clauses
Admin
The web page is kind of slow, so perhaps they do a select * on all the pages :-)
Admin
How I quit my last job:
I was hired as The Database Person. No one else on the team had any DB experience whatsoever. Including, and this is critical, my manager and the senior architect.
We built software to manage things that could exist in large numbers. Really large numbers. 10^7 things per gadget, and there could be 10^2 gadgets in play at a time.
Did I mention this was a startup, and thought hiring dedicated testers was "too expensive"? Yeah, that too.
I come on board, and immediately start asking unpleasant questions like "what's the schema" and "where's the test database". Unpleasant, because the answers are things like "we don't know" and "we don't have one".
So I check the database we've got, grovel through code, and fix stuff until code agrees with database (don't ask). And then I generate me a really big dataset. You know, a full set of data for all of one of our thingies. And I run a query.
And go home for the night.
And come in 12 hours later, and it's still running.
Self, says I, we have a problem here.
So I grovel through more code, and discover the "Why use a WHERE clause when you can do in memory filtering. And why not do it over the cross product of a 10^7 row table with a 10^5 row table while you're at it." pattern in it's full glory.
Yeah.
I killed the query.
About an hour later, I had a new SELECT statement complete with left joins and a WHERE clause. Reran the query, and got results in seconds. Correct ones even.
I check the code in (code review? we're a startup, we don't have time to waste with process) and go talk to my manager. We're shipping something in three weeks to a customer who's going to be doing some performance testing, and this fix should probably be in it.
And am promptly told that the change is "too high risk", and that we "can't afford to destabilize anything, because this is a critical trial for customer X and they won't bite if something breaks". The SA agrees with him.
I went home and sent my resume to a friend who worked at a company I thought was interesting. Two weeks later, I had a new job. Surprising no one except the people who worked there, startup didn't get the contract.
Admin
Wow sounds just like ACCPAC! Search for Order pulls up entire table and searches on one character...
Admin
The names sound made-up to me: Dr Rutherford - Ernest Rutherford, physicist Dr Price - Fisher Price Dr Atkinson - last name of the actor who plays Mr Bean (Rowan Atkinson) Dr Strickland - Strickland Propane from King of the Hill
Admin
DDS-PhD is a degree program for dentists who also are very well-versed in oral health research.
Admin
No kidding?? Who would imagine that? Next you're gonna say that the real city name was Portland and New Portlandopolis is an alias.
If it was that obvious that Aaron wanted to disguise their identities by switching the city name, it is even more obvious he would switch their surnames too
Admin
While it's good fun to have a laugh at companies that do this sort of thing, the truth is probably more complicated. I think that a lot of the software in these vertical niche markets has been around for a long time, and often pre-dates the availability of SQL databases (for various reasons including cost, performance on old hardware etc). This software was often written for proprietary databases that have different data access models (e.g. so-called ISAM databases are based around a concept similar to cursors and moving next/previous on indexes, rather than data sets). The client applications have user interfaces built around this data access model, for example, virtual lists that load only what's visible on the screen, and this usually doesn't translate well to just shoving in a SQL back-end because the filtering is done on the client side. The quick-fix is to get more data than you need, forgoing WHERE clauses in order to avoid completely re-writing the client. Remember, these vertical markets are still very much in 'feature shoot-out' mode (unlike the more mature horizontal market software), and the resources of the companies involved are scarce, so spending several years re-writing the client while putting everything else on hold simply isn't an option. So in summary, I'm not saying that the company wasn't stupid for sending a lot of select statements with no where clauses across the wire, but I doubt very highly that it was due to an ignorance of the WHERE clause. While I enjoy WTF, I think that sometimes it tries a little too hard to emphasise the WTF aspect at the expense of truthfulness. (and if this sounds personal, then it is, but I'm not in any way related to the dental company named in this article).
Admin
This one post just paid for all my time ever reading WTF.
Yes, I'm thinking seriously about opening up a dental practice. One product eval less to worry about.
Admin
Sorry to go against the grain guys, but the real WTF is the consultant's failure to do any testing before putting the new architecture live.
Taking the software vendor's word for it is naïve to say the least.
Admin
Admin
Sounds just like MediStar here in Germany. The app itself isn't stored/cached on the client PC's. Every start requires 8MB to be sent. If you want to see only patients, who i.e. have some kind of diabetes the server sends the whole DB to the client and the filtering gets done there. This is currently only 21MB. The only way to smoothly work from home would be to buy a server license for the practitioners laptop and sync the db at the end of the workday. Nevermind the serverlicense would cost 2900€ instead of the 800€ a client license costs.
If you want to help them to incorporate tech of the 20th century, feel free to apply: http://www.medistar.de/content/unternehmen/karriere_diplomarbeit.html Oh...that's without pay of course. Since they dominate the practitioners market here and their software is the one with the highest price, they can't afford anyone.
/facepalm
Admin
Another great example of a gnome-based business plan. In IT, you'll find two:
Business plan A: step 1: Write good software step 2: ... step 3: Profit!
Business plan B: step 1: Profit. step 2: ... step 3: Write good software
Examples of plan A are most commonly found on Sourceforge, but you'll find hoards of B's pretty much everywhere.
Here's the catch: Neither A nor B usually make it past step 2.
Admin
I guess you could call me a quasi IT person. I run a patient care reporting system for agency. One of the problems we've had as the number of PCRs has increases (about 300,000) right now, is that queries to the database to bring up a report completed TODAY, search back to late 2004 when the system first went on line.
As a result, the retrieval system is plagued by slow downs that sometimes bring the system to a standstill. Add in an ancient IT infrastructure and network slowness in general and I spend a lot of time on the phone with users.
I'm going to remember this story when we re evaluate our contract and interview potential new vendors.
Thanks for the information.
Admin
My practice software (written for the South African/Namibian market) of course uses Dbase files. It does work over the office network, but because it loads 100 MB of patient data to each client (every time the client starts) it doesn't work so well over the 64 KB leased line I have (no T1 in Namibia).
And, generally speaking, once a program gains market share MBAs come in, push the original founders out of the company and introduce telephone support that tells you: "Delphi? What's Delphi? Let me escalate this to the Lead" who then tells you: "Well, we have looked at porting to Kylix on Linux, but found that we need the superior memory management of Windows"
"Okaaaaay" I said, and gently replaced the phone restraining myself from throwing it against the wall and of course now run it on the Mac under Parallells, having figured out a way of automatically mounting the network share in the .xinitrc and tarring/gzipping the 130 MB directory to 7MB for daily backup via the 64 KB line :-)-O.
I'm not a dentist, by the way...
Admin
If you take Eaglesoft version 14 and substitute it into the story above, you'll likely get the same disasterous results.
This is because of something not mentioned in the story at all. Network LATENCY. See http://en.wikipedia.org/wiki/Network_Latency
It is notoriously high on WANs, and it is an absolute killer for "chatty" BDE-ODBC-SQL applications... the technology on which Eaglesoft is built.
The BDE uses client-side caching very effectively. That's its main feature. So the absence of client-side caching is not the problem. The BDE uses server-side cursors on SQL datasets to control row fetching and avoid fetching the entire table. This makes the absence of a Where clause NOT the problem.
Admin
Admin
Reminds me of a project I worked on two years ago. It should create reports for a client, and it needed around 8 to 9 hours to do so. Since it ran only once a month and didn't even have to be created at any exact day (just 'at the beginning of a new month' which really could be any date between the first and the last day of a month) it didn't really matter that it took that long. Only annoying thing was if you noticed some errors you had to fix them and run the whole thing again.
When I decided to look into it, I found things like this: Step 1: Drop and recreate a temp table Step 2: Insert payment data into a temp table, so we don't touch the original data Step 3: Delete everything we do not need from temp data Step 4: Add some more Cols and do some calculations, using the UPDATE statement on SQL Server
So yeah, I too introduced the magical "WHERE clause" and did some other "optimazation techniques" (ie pulling the data into a DataTable, do the calculations there and write everything back with SqlBulkCopy, which was about 60 times faster than using UPDATE statements).
Sometimes makes you wonder what the orignal devs where thinking. You simply don't insert millions of rows into a table and THEN decide that you actually don't need half of it.