DevDisasters

Weekend Drive

Suddenly, and for no apparent reason, an internal support application at Joe R.'s company suffered a slowdown in executing queries and returning data. As the programmer tasked with working on this particular .NET 2.0-based Web app, this sluggish performance affected Joe, as his client-service software was now "unusable."

It was assumed that the root of the problem was Joe's code. However, Joe knew this was unlikely because the code had been working fine when he had left for the weekend.

Tuning the System
When Monday morning arrived, Joe was informed of the application performance issues and the painfully slow responses from the Oracle database servers. He tried everything he could think of to remedy the performance problem: code optimization, query optimization, re-compiling views. Everything. Still, no dice.

The performance issue was making Joe's internal support application run exceedingly slow, and it needed to be fixed. Identifying the root cause kept him busy for most of the day, and the next day, and the next. He even tried executing the SQL Queries directly in his SQL Code editor.

The queries were still very slow. Queries that should have taken milliseconds were taking roughly 30 seconds to execute:

select field1, field2, field3,
    (select field_a from table1
where field_b = a.table_1_id) 
field_a,
    b.field4, a.field6,
    (select field_c from table2
where field_d = a.table_2_id)
field_c,
    (select field_e from table3
where field_f = a.table_3_id) field_e,
a.field7, a.field8,
a.field9 AS "the_field_9",
    (select c.field_g from table4 c 
where c.field_h = a.table_4_id) as "the_field_g",
    (select c.field_g from table4 c 
where c.field_h = a.table_5_id) as "the_field_h",
    (select c.field_g from table4 c
where c.field_h = a.table_6_id) as "the_field_i",
    a.field10, a.field11, a.field12,
    (select d.field_j from table5 
d where d.field_k = a.table_2_id 
and d.field_j = 'My Value') as "the_field_k",
    (select d.field_l from table5 d
where d.field_m = a.table_2_id and
d.field_j = 'My Value') as "the_field_o",
    a.field13, a.field14, a.field15, a.field16,
    (select field_p from table6
where field_q = a.field_r)
field17
    from table0 a, table6 b
    where b.field_s = a.field_t

By this point, Joe had circled back to his original conclusion: It was nothing that he did because everything was working fine the previous Friday. So he knew that something happened over the weekend that he had no control over.

Watch Where You Put That!
Enter the boss' son.

For some reason, the boss' son had put all of the databases on a thumb drive. He was planning on moving the system to another server, and had accidentally put the entire thing on a USB drive.

Whoops.

Once Joe discovered this, the system was placed on the proper server and everything went back to executing smoothly. As far as Joe could tell, the higher-ups never actually said anything to anyone affected by this slip up -- especially the other developers who worked more closely with the DBMS. They just acted like nothing happened.

About the Author

Alex Papadimoulis lives in Berea, Ohio. The principal member of Inedo, LLC, he uses his 10 years of IT experience to bring custom software solutions to small- and mid-sized businesses and to help other software development organizations utilize best practices in their products. On the Internet, Alex can usually be found answering questions in various newsgroups and posting some rather interesting real-life examples of how not to program on his Web site TheDailyWTF.com. You can contact Alex directly via email at [email protected].,

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube