SQL Server Concatenation Operator – Part2

Hi Friends,

Yesterday we have covered some basic points which will help us to understand SQL Server Concatenation operator. If you have missed that post, you can click here to go to the link.

Concatenation operator is a good example of an operator which receives multiple inputs. As an example, let us run following statement.

USE [AdventureWorks2012]

SELECT * FROM Person.Person
UNION ALL
SELECT * FROM Person.Person
UNION ALL
SELECT * FROM Person.Person

ConcatenationGraphicalPlan

ConcatenationToolTip

   

In the example, concatenation operator receives the result of all Clustered Index Scan operators. Internally, it copies all the rows to one output by calling Init() and GetNext().

We can decode the query plan in text and it looks like following image.

ConcatenationTextPlan

SQL Server query processor executes this plan in the same order as it appears on the plan i.e. first is going to be the top one and last is the end one.

Tomorrow we are going to explore more on this operator, till then.

Happy learning!

Regards,

Kanchan

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

   

About Kanchan Bhattacharyya

Kanchan is an astute IT professional, a seasoned SQL Database Administrator with 13+ years of industry experience. A calculated risk taker with deep technical knowledge and has gained proficiency in database consulting and solutions across different environments. Kanchan holds MBA degree in IT and an International Executive MBA in Project Management. He is very passionate about SQL Server and holds MCSE (Data Platform), MCSA – SQL 2012, MCITP – SQL 2008 certifications. Currently he is focusing on cloud and latest releases of SQL Server. When not working, Kanchan likes to spend his time reading on new technical developments specifically on SQL Server and other related technologies.

View all posts by Kanchan Bhattacharyya →

Leave a Reply

Your email address will not be published.