What was your coolest SQL optimization, on a slow performing query?

后端 未结 15 2154
遥遥无期
遥遥无期 2021-02-10 06:45

Just speaking to a colleague of mine. He was walking with a hop in his step, on the way to the coffee machine.

I asked him \"what\'s with the \'swarmy\' walk?\", he said

15条回答
  •  悲&欢浪女
    2021-02-10 07:23

    (Half way of topic)

    I rewrote a 3000 line stored procedure into LINQ2SQL/C#. The stored procedure juggled lots of data between a bunch of unindexed temp tables. The LINQ2SQL version read the data into a couple of Dictionaries and ILookups and then I joined the data manually with plain old C# code.

    The stored procedure took about 20 seconds and the LINQ2SQL/C# version took 0.2 seconds.

提交回复
热议问题