我們有一個場景,如下所述,需要最佳邏輯輸入。 數據庫是sql server 2012. 我有一個表abc列'a','b','c'和日期字段'd'。 if table abc has 10 records with different dates,which is the best optimized way to have column'a','b','c'以及'd' 其中'd'只是整個記錄的最大
我可以爲空DeletedDate列在我的表中,每當我寫這些表的查詢,我通常檢查,以確保DeletedDate IS NULL。我的想法是,如果我創建一個名爲IsDeleted的索引持久計算列,它可能會加快我的查詢速度,因爲它只需要檢查單個位值,而不是索引一系列日期。 [IsDeleted] AS (isnull(CONVERT([bit],case when [DeletedDate] IS NU