I'm CaLendarW Blog

Rebuild Index on MsSQL

by calendarw on Apr.28, 2009, under database

今日要對現有既 Table 做 Performance Testing, 但因為要 join 太多既 Table, 搜尋一個要 join 4 個 Table 先拎到想要既 “一隻” Record 既時間竟然要 11 秒, 可想而知個 Table Size 有幾大吧 (其實七位數字既 Record Count 啫, 而 where case 只有兩個用 ‘=’ 既 criteria, 而且所有 Record 只能 insert, 不能 delete).

經過我 rebuild 過接近 10 個已有既 index 之後 (等了好幾分鐘), 搜尋時間減少至只需 5 秒…

以下係 mssql 2005 下 rebuild index 既一個 statement 既例子

ALTER INDEX IX_tblMaster ON tblMaster REBUILD;

IX_tblMaster 係 index 名
tblMaster 係 table 名

:,

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!