• (cs) in reply to ChiefCrazyTalk
    ChiefCrazyTalk:
    There is no need for a "Where" clause as long as you use the "Top" statement. Concerned about returning too many records? Just write code like "SELECT TOP 10 * FROM PATIENTS (nolock)". The nolock is for advanced dentists only.

    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.

  • (cs) in reply to Jared
    Jared:
    Wow, all this client/server side talk, running MS SQL over networks, makes me think how hard it must be for you guys trying to do this using MS products.

    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?

  • (cs)

    While it's possible to have both a DDS and a PhD, the honorific "DDS/DDS-PhD" makes no sense to me at all.

  • (cs) in reply to Someone You Know
    Someone You Know:
    While it's possible to have both a DDS and a PhD, the honorific "DDS/DDS-PhD" makes no sense to me at all.

    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?

  • (cs) in reply to DentalGuy

    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

  • - (unregistered) in reply to Outlaw Programmer
    Outlaw Programmer:
    I guess this is what happens when you have a C/C++/Java developer in charge of the database stuff. They don't know much about SQL so they do the bare minimum and clean up the results in their language of choice.

    I hope that you are talking about those without proper education? Anyone with a CS degree should know about WHERE-clauses

  • - (unregistered) in reply to Cale
    Cale:
    http://patterson.eaglesoft.net/

    Perhaps even more interesting?

    The web page is kind of slow, so perhaps they do a select * on all the pages :-)

  • mouse-anon (unregistered) in reply to -

    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.

  • Keith (unregistered)

    Wow sounds just like ACCPAC! Search for Order pulls up entire table and searches on one character...

  • (cs)

    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

  • Just Because You Don't Know Doesn't Mean It Doesn't Exist (unregistered) in reply to GalacticCowboy

    DDS-PhD is a degree program for dentists who also are very well-versed in oral health research.

  • Smash (unregistered) in reply to andreyvul
    andreyvul:
    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

    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

  • ThePosterFormerlyKnownAsRichard (unregistered) in reply to rycamor

    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).

  • Dingbat (unregistered) in reply to operagost

    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.

  • Tim (unregistered)

    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.

  • (cs) in reply to Smash
    Smash:
    andreyvul:
    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

    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

    Huh. I missed the city name. Thanks1!1

  • medistar (unregistered)

    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

  • (cs)

    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.

  • Gary (unregistered)

    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.

  • Eberhard Lisse (unregistered) in reply to rycamor
    rycamor:

    But on to the WTF, I have to agree with the poster above that this sort of thing is endemic to software written for 'vertical markets'; one or two companies establish a foothold early on (as this one probably did in the 80s), and then manage to become de facto standards, since markets like this take a LOT of work to break into.

    Also, software companies for this sort of market are often founded by former professionals IN the market, rather than people experienced at running software companies. Thus the company founder doesn't really have the knowledge to tell a good programmer from a bad one, or what sorts of skills are really needed. These programmers might have been good at client-side GUIs, but obviously had almost no knowledge of server-side applications or databases.

    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...

  • onealm (unregistered) in reply to operagost

    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.

  • Sarah H. (unregistered)
    Digging further, Aaron figured out that, whenever a user wanted to look up a patient, the program would run “SELECT * FROM Patients” query, returning the entire Patients table to the client computer.

    What’s worse, the query would run any time a character was typed in the patient search box. Searching for just his first name – A-A-R-O-N – resulted in five SELECT * queries.

    When my father broke his arm this past December, this is how the hospital's database worked. It had shiny new software that had just been installed and linked to a database of patients for hospitals for the 2 nearest major cities (KC and Saint Louis), rather than just checking locally. Needless to say, we were not amused while my father sat in pain with a compound fracture and we waited for every patient with an "H" in their last name to be loaded.

  • Hannes (unregistered)

    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.

Leave a comment on “Rutherford, Price, Atkinson, Strickland, and Associates Dentistry, Inc”

Log In or post as a guest

Replying to comment #:

« Return to Article