THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » T-SQL » Performance   (RSS)
Showing page 3 of 4 (32 total posts)
  • Multiple-Valued Parameters

    So I was doing some research on which is the best way to pass multiple-valued parameters into a stored procedure or user-defined function when I found some interesting results. I had always used a string-based user-defined function to parse a delimited list of values and I knew I could use XML to do the same thing, yet I had never compared the two ...
    Posted to Peter DeBetta's SQL Programming Blog (Weblog) by Peter DeBetta on February 12, 2007
  • Medians, Actual Query Cost, and Statistics

    I was going to comment on Adam's post ''Medians, ROW_NUMBERs, and performance'' (which was a follow-up to Aaron's post ''Take the high road to middle ground'') and I realized that I needed to show some code and alas, comments are not so nice about formatting code, so I am posting a follow-up post... At the PASS Summit back in November, ...
    Posted to Peter DeBetta's SQL Programming Blog (Weblog) by Peter DeBetta on December 20, 2006
  • Medians, ROW_NUMBERs, and performance

    A couple of days ago, Aaron Bertrand posted about a method for calculating medians in SQL Server 2005 using the ROW_NUMBER function in conjunction with the COUNT aggregate. This method (credited to Itzik Ben-Gan) is interesting, but I discovered an even better way to attack the problem in Joe Celko's Analytics and OLAP in SQL.Rather than using a ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on December 18, 2006
  • The prime number challenge – great waste of time!

    No sane person would even consider using SQL Server to construct a list of prime numbers. So just to prove that I’m not sane (as if there could be any doubt!), this post will be about finding prime numbers.   First a bit of history. Ward Pond wrote about efficient ways to populate a table with one million GUIDs. I posted a comment with a ...
  • Scalar functions, inlining, and performance: An entertaining title for a boring post

    Scalar.  Function.Wow.Could any other combination of words evoke the same feeling of encapsulation, information hiding, and simplification of client code?  After years spent developing software in the procedural and OO worlds, it can be difficult--perhaps, even impossible--to migrate over to working with SQL Server and not consider how ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on August 3, 2006
  • Relating unrelated rows

    A recurring question in the newsgroups is: “How do I output unrelated rows side by side?”   I’ll use the AdventureWorks database as an example. Suppose that my manager wants a report listing, for each order, all products ordered and all reasons the customer has for ordering from AdventureWorks. Here’s a sample of how the report should ...
  • Running sums, redux

    Siddhartha Gautama, the Buddha, taught us to understand that the key to enlightenment is following the Middle Path.  And today I learned a valuable lesson in extremes.  You can file this one in the ''Doh!  Wrong again!'' category... A fairly common question on SQL Server forums is, ''how can I get the running sum of the data ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on February 27, 2006
  • Controlling Stored Procedure Caching with ... Dyanmic SQL?!?

    Tell me if this situation sends a chill down your spine: You've written a stored procedure, tested it against a variety of inputs, and finally rolled it out in production. All is well... Or so you think. You start getting complaints from some users that it's taking forever to return. But other users are having no problem. What ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on January 7, 2005
  • Performance: ISNULL vs. COALESCE

    Mladen aka spirit1 posted a speed test of COALESCE vs. ISNULL. Reported result: COALESCE is faster. But leave it to Anatoly Lubarsky to argue with what was posted. He posted his own speed test, showing that ISNULL is faster. Anatoly's results showed a miniscule difference, ''52 seconds'' vs. ''52-53 seconds''. Mlanden's tests show a ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on November 30, 2004
  • Rowset string concatenation: Which method is best?

    Yeah, yeah, yeah, let's get this out of the way right from the start: Don't concatenate rows into delimited strings in SQL Server. Do it client side. Except if you really have to create delimited strings in SQL Server. In which case you should read on. There was a little discussion on SQLTeam about the best way to concatenate. I ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on November 10, 2004
Privacy Statement