How to determine the size of a full-text index on SQL Server 2008 R2?

I have a SQL 2008 R2 database with some tables that has some of these tables defined by a full-text index. I would like to know how to determine the index size of a particular table in order to control and predict its growth.

Is there any way to do this?

+5
source share
3 answers

The catalog view sys.fulltext_index_fragmentskeeps track of the size of each fragment regardless of the directory, so you can take SUMthis path. This assumes that the restriction of one full-text index per table remains in effect. The following query will give you the size of each full-text index in the database, again, regardless of the directory, but you can use a sentence WHEREif you only need a specific table.

SELECT 
   [table] = OBJECT_SCHEMA_NAME(table_id) + '.' + OBJECT_NAME(table_id), 
   size_in_KB = CONVERT(DECIMAL(12,2), SUM(data_size/1024.0))
 FROM sys.fulltext_index_fragments
 -- WHERE table_id = OBJECT_ID('dbo.specific_table_name')
 GROUP BY table_id;

Also note that if the number of fragments is large, you might consider reorganizing.

+9
source

SSMS - Clik [Database] - []  - { }     - "" .    IN General TAB.. Size = 'nn'

+1

( XML-, )

SELECT  S.name,
        SO.name,
        SIT.internal_type_desc,
        rows = CASE WHEN GROUPING(SIT.internal_type_desc) = 0 THEN SUM(SP.rows)
               END,
        TotalSpaceGB = SUM(SAU.total_pages) * 8 / 1048576.0,
        UsedSpaceGB = SUM(SAU.used_pages) * 8 / 1048576.0,
        UnusedSpaceGB = SUM(SAU.total_pages - SAU.used_pages) * 8 / 1048576.0,
        TotalSpaceKB = SUM(SAU.total_pages) * 8,
        UsedSpaceKB = SUM(SAU.used_pages) * 8,
        UnusedSpaceKB = SUM(SAU.total_pages - SAU.used_pages) * 8
FROM    sys.objects SO
INNER JOIN sys.schemas S ON S.schema_id = SO.schema_id
INNER JOIN sys.internal_tables SIT ON SIT.parent_object_id = SO.object_id
INNER JOIN sys.partitions SP ON SP.object_id = SIT.object_id
INNER JOIN sys.allocation_units SAU ON (SAU.type IN (1, 3)
                                        AND SAU.container_id = SP.hobt_id)
                                       OR (SAU.type = 2
                                           AND SAU.container_id = SP.partition_id)
WHERE   S.name = 'schema'
        --AND SO.name IN ('TableName')
GROUP BY GROUPING SETS(
                       (S.name,
                        SO.name,
                        SIT.internal_type_desc),
                       (S.name, SO.name), (S.name), ())
ORDER BY S.name,
        SO.name,
        SIT.internal_type_desc;

, sys.fulltext_index_fragments, sys.partitions , EXEC sys.sp_spaceused @objname = N'schema.TableName';.

SQL Server 2016, , 2008 .

+1

All Articles