[MSSQL]index fragment

有關資料庫的討論, 都可以在這發表哦~~
回覆文章
頭像
tim
文章: 1379
註冊時間: 2008年 11月 26日, 00:49

[MSSQL]index fragment

文章 tim »

index fragment

檢視每一個索引的片段(Index fragmentation)資訊
http://sharedderrick.blogspot.com/2010/ ... ation.html


Microsoft SQL Server 2000 Index Defragmentation Best Practices
http://technet.microsoft.com/zh-tw/libr ... us%29.aspx

重新組織和重建索引
http://technet.microsoft.com/zh-tw/libr ... 89858.aspx

sys.dm_db_index_physical_stats (Transact-SQL)
http://technet.microsoft.com/zh-tw/libr ... 88917.aspx

ALTER INDEX (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms188388.aspx


Using Covering Indexes to Improve Query Performance
http://www.simple-talk.com/sql/learn-sq ... rformance/

代碼: 選擇全部

CREATE NONCLUSTERED INDEX [ix_Customer_Email] ON [dbo].[Customers]
(
            [Last_Name] ASC,
            [First_Name] ASC
)
INCLUDE ( [Email_Address]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
Table and Index size in SQL Server
http://stackoverflow.com/questions/3168 ... sql-server

代碼: 選擇全部

SELECT
    i.name                  AS IndexName,
    s.used_page_count * 8   AS IndexSizeKB
FROM sys.dm_db_partition_stats  AS s 
JOIN sys.indexes                AS i
ON s.[object_id] = i.[object_id] AND s.index_id = i.index_id
WHERE s.[object_id] = object_id('Vlog')
ORDER BY i.name
SQL Server Indexes
http://odetocode.com/articles/70.aspx
多多留言, 整理文章, 把經驗累積下來.....
回覆文章