Hi Friends,

This is the third part on SQL Server Concatenation operator and if you missed my earlier posts, you can read Part1 and Part2 to understand the background of this blog post.

We saw that, concatenation operator reads each of its input in sequence then produce its output. We can say it is an n-ary physical operator i.e. it can have 2..n inputs. Today, let us slightly modify our query from yesterday then understand the internal workings of this operator.




Both graphical and text plan above produced a separate index seek on BusinessEntityID in the same order as specified in the query reading top down.  The topmost index seek is for the BusinessEntityID 20, then 19, 21 and 22.

As mentioned earlier, concatenation operator reads its inputs in sequence then produce the output, so we can say there is a good chance that the result set will show rows for 20, then 19, 21 and 22 though we cannot guarantee but fair to say this is how this operator works.

I’ll be back tomorrow with a new operator tomorrow, watch out this space for more.

Happy Learning!



Like us on FaceBook | Join the fastest growing SQL Server group on FaceBookFollow me on TwitterFollow me on FaceBook