• (disco)

    [quote=DBA from TFA]Please tell me this wasn't found in our product...[/quote] Well, Ralph could now claim he found it at TheDailyWTF with their product following a similar pattern.

  • (disco)

    a team that was moving so quickly...

    a team that

    had blown several deadlines

    over a period of 2 years.

    This must be some new definition of quickly that I'm not familiar with. Or maybe it's just a different kind of movement.

  • (disco)

    https://pbs.twimg.com/media/BDk7b_aCcAEpBjA.jpg

  • (disco)

    But why?

  • (disco)

    apparently comments are not "agile"

    Of course they're not. Writing code is too time-consuming already without them.

  • (disco)

    So, how would you have done the pack-several-records-in-a-struct thing with C# and SQL Server? XML parameters?

  • (disco) in reply to ChrisH

    Simple: XMSQL#.Linq

  • (disco) in reply to ChrisH

    Well I do not know if it would work, but with XML it would at least be Enterprisy.... :smile:

  • (disco) in reply to ChrisH
    ChrisH:
    So, how would you have done the pack-several-records-in-a-struct thing with C# and SQL Server?

    Where do all those records come from? As there wasn't a DBA on the project I find myself wondering if the whole thing couldn't have been done by a stored procedure extracting the original data into as many temp tables as needed, then doing any necessary joins, sorts and extracts, and finally reading the result into the temp table.

  • (disco) in reply to HardwareGeek

    Painstakingly agile.

  • (disco) in reply to kupfernigk

    Where do all those records come from? As there wasn't a DBA on the project I find myself wondering if the whole thing couldn't have been done by a stored procedure extracting the original data into as many temp tables as needed, then doing any necessary joins, sorts and extracts, and finally reading the result into the temp table.

    Oh you mean by creating a view which could then be directly queried?

  • (disco)

    "The term Wunderkind (from German: "wonder child") "

    In the software world usually neither "wonder" nor "child" actually applies.

  • (disco)

    This used to be the recommended way to pass this type of thing into SQL Server. Table variables (which are great) still generated a ton of individual database calls, SQL Bulk Copy required an actual table to be created (or clever use of a permanent "temp" table and a scope field that differentiated each call). XML worked once SQL Server supported xml queries, but there was a ton of transport overhead for that. Entity Framework/LINQ2SQL just generated a bajillion individual inserts the last time I looked.

    Of course, documentation would have been good, but he probably just copied & pasted from an answer on some blog because he was a Wunderkind.

  • (disco)

    TRWTF here is that apparently neither the Wunderkind nor the author of the article has heard of BULK INSERT, which is how you solve the problem that the Wunderkind is attempting to solve here in a supported, well-understood way.

    One time I was asked to look at some reporting code that could take several hours to run. After a bit of spelunking I realized that most of the time was being taken up by processing a few million INSERT statements, each one being run as its own call to the database, over the network, with all the latency that implies. So I reworked the system to use a single bulk insert and sent it to the PM to give to the client.

    The next day, I got a panicky call from the PM, stating that my code wasn't working. I double-checked their database, and told her that it sure looked like everything had run successfully. She was like, "wait... you mean it's done already?!? They came back to check after 45 minutes and found it doing nothing!" Turns out the whole thing had taken about 15 minutes to run, down from around 8 hours.

  • (disco) in reply to Mason_Wheeler

    A 30-times speedup? Nice!

    (The best I've done with optimizing things in recent years was about 25-times, but that was without switching algorithms so it still isn't shabby. And it wasn't with DB interactions.)

  • (disco) in reply to RFoxmich
    RFoxmich:
    In the software world usually neither "wonder" nor "child" actually applies.

    I wonder if it would be childish to point out the word "wund"...

  • (disco) in reply to boldtbanan
    boldtbanan:
    he probably just copied & pasted from an answer on some blog

    All good blogs with code samples I've seen so far are unsparingly commented.

    Oh wait...

Leave a comment on “The Wunderkind”

Log In or post as a guest

Replying to comment #:

« Return to Article