Last week I presented at the Southern New England SQL Server User Group (SNESSUG) where I’m the Program Director. I presented from the book, Dissecting Execution Plans, that is supposed to be published any day now. I kept it basic and it flowed very well. The audience seemed receptive and there were a few questions. Mostly around figuring out what to do when you saw certain problems within the execution plans. Since that was the goal of the presentation, I was ready for most of the questions. I got stumped once on a Constant Scan operation.
I finally looked it up this morning and feel silly. Here’s the query:
INSERT INTO [AdventureWorks].[Person].[Address]
    ([AddressLine1]
    ,[AddressLine2]
    ,[City]
    ,[StateProvinceId]
    ,[PostalCode]
    ,[rowguid]
    ,[ModifiedDate]
VALUES (‘1313 Mockingbird Lane’
    ,’Basement’
    ,’Springfield’
    ,24
    ,’02134′
    ,NEWID()
    ,GETDATE());
Silly simple right? It creates an execution plan that starts with the Constant Scan operator. For those who aren’t snickering behind their hands because I forgot this simple fact, the Constant Scan operator creates a blank row, or rows, for the query in question to begin filling in. Simple. I still feel goofy that I didn’t remember it.