Don't bloat plan cache No. 2
I have ~15k variations of this query in my plan cache, each with varying handles and a varying number of INSERTs.
DECLARE @plans TABLE (planhandle varbinary(64) NOT NULL)
INSERT INTO @plans VALUES(0x06000b008697d33ae0e92c011c00000001000000000000000000000000000000000000000000000000000000)
INSERT INTO @plans VALUES(0x06000b000ddbda05a03c83f01d00000001000000000000000000000000000000000000000000000000000000)
INSERT INTO @plans VALUES(0x06000b00263e3902f0b1112b1900000001000000000000000000000000000000000000000000000000000000)
INSERT INTO @plans VALUES(0x05000b009ee99729a0b9945b1600000001000000000000000000000000000000000000000000000000000000)
INSERT INTO @plans VALUES(0x06000b0059af9b291063a6951900000001000000000000000000000000000000000000000000000000000000)
INSERT INTO @plans VALUES(0x06000b0094ca3316501fee2c1600000001000000000000000000000000000000000000000000000000000000)
INSERT INTO @plans VALUES(0x05000b0065c5a32880b2945b1600000001000000000000000000000000000000000000000000000000000000)
SELECT planhandle ,
queryplaninfo.queryplan
FROM @plans
OUTER APPLY sys.dmexecqueryplan(planhandle) AS queryplan_info
-
Chris Fox commented
Optimize for ad-hoc workloads?
-
Thomas Franz commented
PS: there should be already an internal ticket SRP-10897 regarding this topic.