1
为什么对分区视图执行删除会导致聚集索引插入?
我有一个分区视图,具有下面的插入触发器(可怜的芒分区)。当我执行DELETE时,我得到以下查询计划: delete from factproductprice where pricedate = '20170725' 在视图上触发: ALTER TRIGGER [dbo].[factProductPriceDelete] ON [dbo].[FactProductPrice] INSTEAD OF DELETE AS BEGIN IF @@ROWCOUNT = 0 RETURN; DECLARE @PriceDate DATE SELECT @PriceDate = CAST(PriceDate AS DATE) FROM DELETED IF @PriceDate BETWEEN '20140101' AND '20141231' BEGIN DELETE FROM dbo.FactProductPrice2014 WHERE ProductId IN (SELECT ProductId …