SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[SC_Product_Select_PuerTeaList_0]
(
@startIndex int,
@endIndex int
)
AS
SET NOCOUNT ON
SET Rowcount @endIndex
SELECT identity(int,1,1) as PageID, cast(PID as int) as PID, pTitle, pMainImage228, pMarketPrice, pPrice into #ProTable FROM SC_Product
ORDER BY pUpDate DESC
create clustered index index_PageID on #ProTable(PageID)
SELECT * FROM #ProTable WHERE PageID BETWEEN @startIndex AND @endIndex
SET NOCOUNT OFF
RETURN
这是一个分页代码,请问上面给临时表建立聚集索引会不会提高效率(若只有2000条数据)。