Craig Freedman's SQL Server Blog

A discussion of query processing, query execution, and query plans in SQL Server.
Posts
  • Craig Freedman's SQL Server Blog

    Subqueries: ANDs and ORs

    • 5 Comments
    In my “Introduction to Joins” post , I gave an example of how we can use a semi-join to evaluate an EXISTS subquery. Just to recap, here is another example: create table T1 ( a int , b int ) create table T2 ( a int ) create table T3 ( a int ...
  • Craig Freedman's SQL Server Blog

    Subqueries in CASE Expressions

    • 5 Comments
    In this post, I’m going to take a look at how SQL Server handles subqueries in CASE expressions. I’ll also introduce some more exotic join functionality in the process. Scalar expressions For simple CASE expressions with no subqueries, we can just...
  • Craig Freedman's SQL Server Blog

    Summary of Join Properties

    • 7 Comments
    The following table summarizes the characteristics of the three physical join operators which I described in my three prior posts. Nested Loops Join Merge Join Hash Join Best for … Relatively small inputs...
  • Craig Freedman's SQL Server Blog

    Hash Join

    • 8 Comments
    When it comes to physical join operators, hash join does the heavy lifting. While nested loops join works well with relatively small data sets and merge join helps with moderately sized data sets, hash join excels at performing the largest joins. Hash...
  • Craig Freedman's SQL Server Blog

    Merge Join

    • 14 Comments
    In this post, I’ll describe the second physical join operator: merge join (MJ). Unlike the nested loops join which supports any join predicate, the merge join requires at least one equijoin predicate. Moreover, the inputs to the merge join must be sorted...
Page 1 of 1 (5 items)