Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
SQL Server MVP Deep Dives- P7: Each year Microsoft invites all the MVPs from every technology and country to Redmond for an MVP Summit—all top secret—“don’t tweet what you see!” During the MVP Summit, each product team holds a series of presentations where they explain their technologies, share their vision, and listen to some honest feedback. | 196 Chapter 13 Full-text searching WHEN 0 THEN Newly created and not yet used WHEN 1 THEN Being used for insert WHEN 4 THEN Closed ready for query WHEN 6 THEN Being used for merge input and ready for query WHEN 8 THEN Marked for deletion. Will not be used for query and merge source1 ELSE Unknown status code END FROM sys.fulltext_index_fragments f JOIN sys.tables t on f.table_id t.object_id When this query returns look for rows whose type is 4 or Closed ready for query. A table will be listed once for each fragment it has. If it turns out that you have a high number of closed fragments you should consider doing a REORGANIZE on the index using the ALTER FULLTEXT INDEX statement . Note two things first you must do a reorganize as opposed to a rebuild. Second the exact number of fragments that will cause you issues is somewhat dependant on your hardware. But as a rule of thumb if it exceeds 50 start planning a reorganize and if it s over 100 start planning in a hurry. The keywords We ll close this chapter out by answering one of the most-often-asked questions how can I find out what words are contained in my full-text index New with SQL Server 2008 are a pair of dynamic management functions DMFs that can help us answer that very question. The first is sys.dm_fts_index_keywords. To use this function pass in the database ID and object ID for the table you want to discover the keywords for. It returns a table with many columns this query shows you the more useful ones. Note that it also references the sys.columns view in order to get the column name SELECT keyword display_term c.name document_count FROM sys.dm_fts_index_keywords db_id object_id Production.ProductDescription fik JOIN sys.columns c on c.object_id object_id Production.ProductDescription AND c.column_id fik.column_id The db_id function allows us to easily retrieve the database ID. We then use the object_id function to get the ID for the table name passing in the text-based table name. Table 6 shows a sampling