给视图创建索引
alter VIEW [dbo].[F_table_SCreateBarQty] with schemabinding
AS
SELECT F_SourceID,F_SourceEntry,SUM(F_Number) AS FBarQTY,COUNT_BIG(*) AS F FROM dbo.F_table
WHERE F_State<>8 and F_SourceType='MES_Delivery' AND F_CodeType=2 GROUP BY F_SourceID,F_SourceEntry
GO
create unique clustered index ix_uniquetb on F_table_SCreateBarQty(F_SourceID,F_SourceEntry)