创建索引

查看执行计划前

SET STATISTICS TIME ON;
GO
SET STATISTICS IO ON;
GO

创建更新索引

	USE XXX;
	GO
	-- create\update index 1: [IX_FileItem_XLIFFFileGuid_State]
	if exists(select * from sysindexes where name='IX_FileItem_XLIFFFileGuid_State')
	DROP  index [IX_FileItem_XLIFFFileGuid_State] ON FileItem;
	GO
	CREATE NONCLUSTERED INDEX [IX_FileItem_XLIFFFileGuid_State]
	ON [dbo].[FileItem] ([XLIFFFileGuid],[State])
	INCLUDE ([UpdatedAt],[FileGuid])
	GO


	-- create\update index 2: [IX_File_TargetType]
	if exists(select * from sysindexes where name='IX_File_TargetType')
	DROP  index [IX_File_TargetType] ON [File];
	GO
	CREATE NONCLUSTERED INDEX [IX_File_TargetType]
	ON [dbo].[File] ([TargetType])
	INCLUDE ([Guid],[TargetGuid],[SourceLanguage],[TargetLanguages])
	GO

        --查看所有索引
	--select * from sysindexes where name LIKE '%IX%'
上一篇:JavaIO流(2) ------图片上传,(基于servlet)


下一篇:Java接口和抽象类有什么区别,哪些时候用接口,哪些时候用抽象类?