Reading SQL PDW Query Plans (Part 2)
Querying a Distributed Table
In the first part of this series, we took a look at a very simple query that hit a single replicated table. Let’s take a look at another fairly straightforward query. A simple query that queries a single distributed table. I know these may seem simplistic, but I believe that building upon the straightforward helps us understand the more complicated stuff coming up. Here is the query:
Looking at the query plan for this query, we can see that there are only two steps.
0. OnOperation that runs the query on all distributions.
1. ReturnOperation that streams the results back to the client.
By clicking on the View Details link for Step ID 0, we get the following page(click to enlarge).
Just like in the example of a simple query against a replicated table, a simple query against a distributed table does not involved storing any data on the control node. Once results are returned back from the compute node, the results are streamed directly to the client. The power of
Another look at the query plan (click to enlarge):
In the next post we’ll start looking at what happens when you join dimension tables to fact tables. At the physical level, that would be a replicated table joined to a distributed table.