CREATE STATISTICS (Transact-SQL)CREATE STATISTICS (Transact-SQL)

適用於: 是SQL Server 是Azure SQL Database 是Azure Synapse Analytics (SQL DW) 是平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) yesParallel Data Warehouse

在資料表、索引檢視表或外部資料表的一或多個資料行建立查詢最佳化統計資料。Creates query optimization statistics on one or more columns of a table, an indexed view, or an external table. 對於大部分查詢而言,查詢最佳化工具已經產生高品質查詢計劃的必要統計資料。不過,在少數情況下,您必須使用 CREATE STATISTICS 來建立其他統計資料或修改查詢設計,以便改善查詢效能。For most queries, the query optimizer already generates the necessary statistics for a high-quality query plan; in a few cases, you need to create additional statistics with CREATE STATISTICS or modify the query design to improve query performance.

若要深入了解,請參閱統計資料To learn more, see Statistics.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

-- Syntax for SQL Server and Azure SQL Database  
  
-- Create statistics on an external table  
CREATE STATISTICS statistics_name   
ON { table_or_indexed_view_name } ( column [ ,...n ] )   
    [ WITH FULLSCAN ] ;  
  
-- Create statistics on a regular table or indexed view  
CREATE STATISTICS statistics_name   
ON { table_or_indexed_view_name } ( column [ ,...n ] )   
    [ WHERE <filter_predicate> ]  
    [ WITH   
        [ [ FULLSCAN   
            [ [ , ] PERSIST_SAMPLE_PERCENT = { ON | OFF } ]    
          | SAMPLE number { PERCENT | ROWS }   
            [ [ , ] PERSIST_SAMPLE_PERCENT = { ON | OFF } ]    
          | <update_stats_stream_option> [ ,...n ]    
        [ [ , ] NORECOMPUTE ]   
        [ [ , ] INCREMENTAL = { ON | OFF } ] 
        [ [ , ] MAXDOP = max_degree_of_parallelism ]
    ] ;  
  
<filter_predicate> ::=   
    <conjunct> [AND <conjunct>]  
  
<conjunct> ::=  
    <disjunct> | <comparison>  
  
<disjunct> ::=  
        column_name IN (constant ,...)  
  
<comparison> ::=  
        column_name <comparison_op> constant  
  
<comparison_op> ::=  
    IS | IS NOT | = | <> | != | > | >= | !> | < | <= | !<  
    
<update_stats_stream_option> ::=  
    [ STATS_STREAM = stats_stream ]  
    [ ROWCOUNT = numeric_constant ]  
    [ PAGECOUNT = numeric_contant ] 
-- Syntax for Azure SQL Data Warehouse and Parallel Data Warehouse  
  
CREATE STATISTICS statistics_name   
    ON { database_name.schema_name.table_name | schema_name.table_name | table_name }
    ( column_name  [ ,...n ] )   
    [ WHERE <filter_predicate> ]  
    [ WITH {  
           FULLSCAN   
           | SAMPLE number PERCENT   
      }  
    ]  
[;]  
  
<filter_predicate> ::=   
    <conjunct> [AND <conjunct>]  
  
<conjunct> ::=  
    <disjunct> | <comparison>  
  
<disjunct> ::=  
        column_name IN (constant ,...)  
  
<comparison> ::=  
        column_name <comparison_op> constant  
  
<comparison_op> ::=  
    IS | IS NOT | = | <> | != | > | >= | !> | < | <= | !<  

引數Arguments

statistics_namestatistics_name
這是要建立之統計資料的名稱。Is the name of the statistics to create.

table_or_indexed_view_nametable_or_indexed_view_name
這是要在其上建立統計資料之資料表、索引檢視表或外部資料表的名稱。Is the name of the table, indexed view, or external table on which to create the statistics. 若要在另一個資料庫上建立統計資料,請指定限定的資料表名稱。To create statistics on another database, specify a qualified table name.

column [ ,...n]column [ ,...n]
要在統計資料中包含的一或多個資料行。One or more columns to be included in the statistics. 資料行應該由左至右依優先順序排列。The columns should be in priority order from left to right. 只有第一個資料行用來建立色階分佈圖。Only the first column is used for creating the histogram. 所有資料行都是用於名為密度的跨資料行相互關聯統計資料。All columns are used for cross-column correlation statistics called densities.

您可以指定任何可指定為索引鍵資料行的資料行,但下列例外狀況除外:You can specify any column that can be specified as an index key column with the following exceptions:

  • 您無法指定 Xml、全文檢索和 FILESTREAM 資料行。Xml, full-text, and FILESTREAM columns cannot be specified.

  • 只有在 ARITHABORT 和 QUOTED_IDENTIFIER 資料庫設定為 ON 時,才能指定計算資料行。Computed columns can be specified only if the ARITHABORT and QUOTED_IDENTIFIER database settings are ON.

  • 如果 CLR 使用者定義型別可支援二進位排序,您可以指定這個類型的資料行。CLR user-defined type columns can be specified if the type supports binary ordering. 如果方法標示為具決定性,就能指定從使用者定義型別資料行中定義為方法引動過程的計算資料行。Computed columns defined as method invocations of a user-defined type column can be specified if the methods are marked deterministic.

WHERE <filter_predicate> 指定運算式,以便選取在建立統計資料物件時要包含的資料列子集。WHERE <filter_predicate> Specifies an expression for selecting a subset of rows to include when creating the statistics object. 使用篩選述詞所建立的統計資料稱為篩選的統計資料。Statistics that are created with a filter predicate are called filtered statistics. 篩選述詞會使用簡單比較邏輯,而且無法參考計算資料行、UDT 資料行、空間資料類型資料行或 hierarchyID 資料類型資料行。The filter predicate uses simple comparison logic and cannot reference a computed column, a UDT column, a spatial data type column, or a hierarchyID data type column. 比較運算子不允許使用 NULL 常值的比較。Comparisons using NULL literals are not allowed with the comparison operators. 請改用 IS NULL 和 IS NOT NULL 運算子。Use the IS NULL and IS NOT NULL operators instead.

以下是 Production.BillOfMaterials 資料表之篩選述詞的一些範例:Here are some examples of filter predicates for the Production.BillOfMaterials table:

  • WHERE StartDate > '20000101' AND EndDate <= '20000630'

  • WHERE ComponentID IN (533, 324, 753)

  • WHERE StartDate IN ('20000404', '20000905') AND EndDate IS NOT NULL

如需篩選述詞的詳細資訊,請參閱建立篩選的索引For more information about filter predicates, see Create Filtered Indexes.

FULLSCANFULLSCAN
透過掃描所有資料列來計算統計資料。Compute statistics by scanning all rows. FULLSCAN 和 SAMPLE 100 PERCENT 的結果相同。FULLSCAN and SAMPLE 100 PERCENT have the same results. FULLSCAN 不能搭配 SAMPLE 選項一起使用。FULLSCAN cannot be used with the SAMPLE option.

當略過時,SQL Server 會使用取樣來建立統計資料,並判斷建立高品質查詢計劃所需的樣本大小When omitted, SQL Server uses sampling to create the statistics, and determines the sample size that is required to create a high quality query plan

SAMPLE number { PERCENT | ROWS }SAMPLE number { PERCENT | ROWS }
指定當查詢最佳化工具建立統計資料時,要在資料表或索引檢視表中使用的近似百分比或資料列數目。Specifies the approximate percentage or number of rows in the table or indexed view for the query optimizer to use when it creates statistics. 針對 PERCENT,number 可以介於 0 到 100 之間;針對 ROWS,number 可以介於 0 到總資料列數目之間。For PERCENT, number can be from 0 through 100 and for ROWS, number can be from 0 to the total number of rows. 查詢最佳化工具所取樣的實際百分比或資料列數目可能會與指定的百分比或數目不符。The actual percentage or number of rows the query optimizer samples might not match the percentage or number specified. 例如,查詢最佳化工具會掃描資料頁面上的所有資料列。For example, the query optimizer scans all rows on a data page.

在特殊情況下,根據預設取樣的查詢計劃並非最佳化,此時 SAMPLE 便非常有用。SAMPLE is useful for special cases in which the query plan, based on default sampling, is not optimal. 通常,查詢最佳化工具已經會依預設使用取樣並決定具有統計價值的取樣大小,因此不需要使用 SAMPLE 便可以建立高品質的查詢計劃。In most situations, it is not necessary to specify SAMPLE because the query optimizer already uses sampling and determines the statistically significant sample size by default, as required to create high-quality query plans.

SAMPLE 不能和 FULLSCAN 選項一起使用。SAMPLE cannot be used with the FULLSCAN option. 如果 SAMPLE 或 FULLSCAN 都未指定,查詢最佳化工具會依預設使用取樣資料並計算取樣大小。When neither SAMPLE nor FULLSCAN is specified, the query optimizer uses sampled data and computes the sample size by default.

我們建議您不要指定 0 PERCENT 或 0 ROWS。We recommend against specifying 0 PERCENT or 0 ROWS. 將 PERCENT 或 ROWS 指定為 0 時,雖會建立統計資料物件,但是不會包含統計資料。When 0 PERCENT or ROWS is specified, the statistics object is created but does not contain statistics data.

PERSIST_SAMPLE_PERCENT = { ON | OFF }PERSIST_SAMPLE_PERCENT = { ON | OFF }
當設定為 ON 時,統計資料將針對未明確指定取樣百分比的後續更新,保留特定的取樣百分比。When ON, the statistics will retain the creation sampling percentage for subsequent updates that do not explicitly specify a sampling percentage. 當設定為 OFF 時,統計資料取樣百分比將重設為未明確指定取樣百分比之後續更新中的預設取樣。When OFF, statistics sampling percentage will get reset to default sampling in subsequent updates that do not explicitly specify a sampling percentage. 預設值為 OFFThe default is OFF.

注意

如果資料表遭到截斷,則所有以遭截斷 HoBT 為基礎建置的統計資料都會還原至使用預設取樣百分比。If the table is truncated, all statistics built on the truncated HoBT will revert to using the default sampling percentage.

適用於SQL Server 2016 (13.x)SQL Server 2016 (13.x) (從 SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP1 CU4 開始) 及更新版本 (從 SQL Server 2017 (14.x)SQL Server 2017 (14.x) CU1 開始)。Applies to: SQL Server 2016 (13.x)SQL Server 2016 (13.x) (starting with SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP1 CU4) and later (starting with SQL Server 2017 (14.x)SQL Server 2017 (14.x) CU1).

STATS_STREAM = stats_streamSTATS_STREAM =stats_stream

僅供參考之用。Identified for informational purposes only. 不支援。Not supported. 我們無法保證未來的相容性。Future compatibility is not guaranteed.

NORECOMPUTENORECOMPUTE
針對 statistics_name 停用自動統計資料更新選項 AUTO_STATISTICS_UPDATE。Disable the automatic statistics update option, AUTO_STATISTICS_UPDATE, for statistics_name. 如果您指定了這個選項,查詢最佳化工具就會針對 statistics_name 完成任何進行中的統計資料更新並停用未來的更新。If this option is specified, the query optimizer will complete any in-progress statistics updates for statistics_name and disable future updates.

若要重新啟用統計資料更新,請使用 DROP STATISTICS 來移除統計資料,然後再執行不含 NORECOMPUTE 選項的 CREATE STATISTICS。To re-enable statistics updates, remove the statistics with DROP STATISTICS and then run CREATE STATISTICS without the NORECOMPUTE option.

警告

使用這個選項可能會產生次佳查詢計劃。Using this option can produce suboptimal query plans. 我們建議您盡量少用這個選項,而且只有合格的系統管理員可以使用。We recommend using this option sparingly, and then only by a qualified system administrator.

如需 AUTO_STATISTICS_UPDATE 選項的詳細資訊,請參閱 ALTER DATABASE SET 選項 (Transact-SQL)For more information about the AUTO_STATISTICS_UPDATE option, see ALTER DATABASE SET Options (Transact-SQL). 如需停用及重新啟用統計資料更新的詳細資訊,請參閱統計資料For more information about disabling and re-enabling statistics updates, see Statistics.

INCREMENTAL = { ON | OFF }INCREMENTAL = { ON | OFF }
若設定為 ON,所建立的統計資料會以每個資料分割統計資料為依據。When ON, the statistics created are per partition statistics. 設定為 OFF 時,會合併所有資料分割的統計資料。When OFF, stats are combined for all partitions. 預設值為 OFFThe default is OFF.

如果不支援依據每個分割區區的統計資料,則會產生錯誤。If per partition statistics are not supported an error is generated. 針對下列統計資料類型,不支援累加統計資料:Incremental stats are not supported for following statistics types:

  • 建立統計資料時,所使用的索引未與基底資料表進行分割區對齊。Statistics created with indexes that are not partition-aligned with the base table.
  • 在 AlwaysOn 可讀取次要資料庫上建立的統計資料。Statistics created on Always On readable secondary databases.
  • 在唯讀資料庫上建立的統計資料。Statistics created on read-only databases.
  • 在篩選的索引上建立的統計資料。Statistics created on filtered indexes.
  • 在檢視上建立的統計資料。Statistics created on views.
  • 在內部資料表上建立的統計資料。Statistics created on internal tables.
  • 使用空間索引或 XML 索引建立的統計資料。Statistics created with spatial indexes or XML indexes.

適用對象SQL Server 2014 (12.x)SQL Server 2014 (12.x) 及更新版本。Applies to: SQL Server 2014 (12.x)SQL Server 2014 (12.x) and later.

MAXDOP = max_degree_of_parallelismMAXDOP = max_degree_of_parallelism
適用於SQL ServerSQL Server (從 SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP2 和 SQL Server 2017 (14.x)SQL Server 2017 (14.x) CU3 開始)。Applies to: SQL ServerSQL Server (Starting with SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP2 and SQL Server 2017 (14.x)SQL Server 2017 (14.x) CU3).

在統計作業期間,覆寫 max degree of parallelism 設定選項。Overrides the max degree of parallelism configuration option for the duration of the statistic operation. 如需詳細資訊,請參閱 設定 max degree of parallelism 伺服器組態選項For more information, see Configure the max degree of parallelism Server Configuration Option. 請利用 MAXDOP 來限制執行平行計畫所用的處理器數目。Use MAXDOP to limit the number of processors used in a parallel plan execution. 最大值是 64 個處理器。The maximum is 64 processors.

max_degree_of_parallelism 可以是:max_degree_of_parallelism can be:

11
隱藏平行計畫的產生。Suppresses parallel plan generation.

>1>1
根據目前的系統工作負載,將平行統計作業所使用的處理器數目上限,限制為所指定的數目或更少的數目。Restricts the maximum number of processors used in a parallel statistic operation to the specified number or fewer based on the current system workload.

0 (預設值)0 (default)
根據目前的系統工作負載,使用實際數目或比實際數目更少的處理器。Uses the actual number of processors or fewer based on the current system workload.

<update_stats_stream_option> 僅供參考之用。Identified for informational purposes only. 不支援。Not supported. 我們無法保證未來的相容性。Future compatibility is not guaranteed.<update_stats_stream_option> 僅供參考之用。Identified for informational purposes only. 不支援。Not supported. 我們無法保證未來的相容性。Future compatibility is not guaranteed.

權限Permissions

需要下列權限其中一個權限:Requires one of these permissions:

  • ALTER TABLEALTER TABLE
  • 使用者是資料表擁有者User is the table owner
  • db_ddladmin 固定資料庫角色中的成員資格Membership in the db_ddladmin fixed database role

一般備註General Remarks

SQL ServerSQL Server 可以使用 tempdb 在建立統計資料之前,將取樣的資料列排序。can use tempdb to sort the sampled rows before building statistics.

外部資料表的統計資料Statistics for external tables

建立外部資料表統計資料時,SQL ServerSQL Server 會將外部資料表匯入暫存的 SQL ServerSQL Server 資料表,然後建立統計資料。When creating external table statistics, SQL ServerSQL Server imports the external table into a temporary SQL ServerSQL Server table, and then creates the statistics. 針對範例統計資料,只有取樣資料列會匯入。For samples statistics, only the sampled rows are imported. 如果您有大型的外部資料表,使用預設取樣的速度會比完整掃描選項快得多。If you have a large external table, it will be much faster to use the default sampling instead of the full scan option.

具有已篩選條件的統計資料Statistics with a filtered condition

對於從定義完善的資料子集中選取的查詢而言,篩選的統計資料可以改善查詢效能。Filtered statistics can improve query performance for queries that select from well-defined subsets of data. 篩選的統計資料會在 WHERE 子句中使用篩選述詞來選取統計資料中所含的資料子集。Filtered statistics use a filter predicate in the WHERE clause to select the subset of data that is included in the statistics.

使用 CREATE STATISTICS 的時機When to Use CREATE STATISTICS

如需使用 CREATE STATISTICS 之時機的詳細資訊,請參閱統計資料For more information about when to use CREATE STATISTICS, see Statistics.

篩選統計資料的參考相依性Referencing Dependencies for Filtered Statistics

sys.sql_expression_dependencies目錄檢視會將篩選統計資料述詞中的每個資料行當做參考相依性來追蹤。The sys.sql_expression_dependencies catalog view tracks each column in the filtered statistics predicate as a referencing dependency. 請在建立篩選統計資料之前先考慮要在資料表資料行上執行的作業,因為在篩選統計資料述詞中定義的資料表資料行是無法卸除、重新命名或變更定義的。Consider the operations that you perform on table columns before creating filtered statistics because you cannot drop, rename, or alter the definition of a table column that is defined in a filtered statistics predicate.

限制事項Limitations and Restrictions

  • 不支援更新外部資料表上的統計資料。Updating statistics is not supported on external tables. 若要更新外部資料表上的統計資料,請卸除並重新建立統計資料。To update statistics on an external table, drop and re-create the statistics.
  • 您最多可以針對每個統計資料物件列出 64 個資料行。You can list up to 64 columns per statistics object.
  • MAXDOP 選項與 STATS_STREAM、ROWCOUNT 及 PAGECOUNT 選項不相容。The MAXDOP option is not compatible with STATS_STREAM, ROWCOUNT and PAGECOUNT options.
  • 如果使用 MAXDOP 選項,會受限於 Resource Governor 工作負載群組 MAX_DOP 設定。The MAXDOP option is limited by the Resource Governor workload group MAX_DOP setting, if used.

範例Examples

範例使用的是 AdventureWorks 資料庫。Examples use the AdventureWorks database.

A.A. 搭配 SAMPLE 數目 PERCENT 使用 CREATE STATISTICSUsing CREATE STATISTICS with SAMPLE number PERCENT

下列範例會使用 ContactMail1 資料庫的 BusinessEntityID 資料表內,EmailPromotionPerson 資料行的 5% 隨機取樣,來建立 AdventureWorks2012AdventureWorks2012 統計資料。The following example creates the ContactMail1 statistics, using a random sample of 5 percent of the BusinessEntityID and EmailPromotion columns of the Person table of the AdventureWorks2012AdventureWorks2012 database.

CREATE STATISTICS ContactMail1  
    ON Person.Person (BusinessEntityID, EmailPromotion)  
    WITH SAMPLE 5 PERCENT;  

B.B. 搭配 FULLSCAN 和 NORECOMPUTE 使用 CREATE STATISTICSUsing CREATE STATISTICS with FULLSCAN and NORECOMPUTE

下列範例會針對 NamePurchase 資料表的 BusinessEntityIDEmailPromotion 資料行中的所有資料列來建立 Person 統計資料,且會停用統計資料的自動重新計算。The following example creates the NamePurchase statistics for all rows in the BusinessEntityID and EmailPromotion columns of the Person table and disables automatic recomputing of statistics.

CREATE STATISTICS NamePurchase  
    ON AdventureWorks2012.Person.Person (BusinessEntityID, EmailPromotion)  
    WITH FULLSCAN, NORECOMPUTE;  

C.C. 使用 CREATE STATISTICS 來建立篩選的統計資料Using CREATE STATISTICS to create filtered statistics

下列範例會建立篩選的統計資料 ContactPromotion1The following example creates the filtered statistics ContactPromotion1. Database EngineDatabase Engine 會取樣百分之 50 的資料,然後選取 EmailPromotion 等於 2 的所有資料列。The Database EngineDatabase Engine samples 50 percent of the data and then selects the rows with EmailPromotion equal to 2.

CREATE STATISTICS ContactPromotion1  
    ON Person.Person (BusinessEntityID, LastName, EmailPromotion)  
WHERE EmailPromotion = 2  
WITH SAMPLE 50 PERCENT;  
GO  

D.D. 在外部資料表上建立統計資料Create statistics on an external table

在外部資料表上建立統計資料時,除了提供資料行清單之外,您唯一要做的決定是要透過為資料列進行取樣或透過掃描所有資料列來建立統計資料。The only decision you need to make when you create statistics on an external table, besides providing the list of columns, is whether to create the statistics by sampling the rows or by scanning all of the rows.

由於 SQL ServerSQL Server 會從外部資料表匯入資料到暫存資料表中,以建立統計資料,因此完整掃描選項會花費更長的時間。Since SQL ServerSQL Server imports data from the external table into a temporary table to create statistics, the full scan option will take much longer. 針對大型資料表,預設的取樣方法通常就已足夠。For a large table, the default sampling method is usually sufficient.

--Create statistics on an external table and use default sampling.  
CREATE STATISTICS CustomerStats1 ON DimCustomer (CustomerKey, EmailAddress);  
  
--Create statistics on an external table and scan all the rows  
CREATE STATISTICS CustomerStats1 ON DimCustomer (CustomerKey, EmailAddress) WITH FULLSCAN;  

E.E. 搭配 FULLSCAN 和 PERSIST_SAMPLE_PERCENT 使用 CREATE STATISTICSUsing CREATE STATISTICS with FULLSCAN and PERSIST_SAMPLE_PERCENT  

下列範例會針對 NamePurchase 中所有資料列和 BusinessEntityID 資料表中的 EmailPromotion 資料行建立 Person 統計資料,並針對未明確指定取樣百分比的所有後續更新,設定 100% 取樣百分比。The following example creates the NamePurchase statistics for all rows in the BusinessEntityID and EmailPromotion columns of the Person table and sets a 100 percent sampling percentage for all subsequent updates that do not explicitly specify a sampling percentage.  

CREATE STATISTICS NamePurchase  
    ON AdventureWorks2012.Person.Person (BusinessEntityID, EmailPromotion)  
    WITH FULLSCAN, PERSIST_SAMPLE_PERCENT = ON;  

使用 AdventureWorksDW 資料庫的範例。Examples using AdventureWorksDW database.

F.F. 建立兩個資料行的統計資料Create statistics on two columns

下列範例會根據 CustomerStats1 資料表的 CustomerKeyEmailAddress 資料行,建立 DimCustomer 統計資料。The following example creates the CustomerStats1 statistics, based on the CustomerKey and EmailAddress columns of the DimCustomer table. 該統計資料是根據 Customer 資料表中統計上很重要的資料列取樣而建立的。The statistics are created based on a statistically significant sampling of the rows in the Customer table.

CREATE STATISTICS CustomerStats1 ON DimCustomer (CustomerKey, EmailAddress);  

G.G. 使用完整掃描建立統計資料Create statistics by using a full scan

下列範例會根據掃描 CustomerStatsFullScan 資料表中的所有資料列來建立 DimCustomer 統計資料。The following example creates the CustomerStatsFullScan statistics, based on scanning all of the rows in the DimCustomer table.

CREATE STATISTICS CustomerStatsFullScan 
ON DimCustomer (CustomerKey, EmailAddress) WITH FULLSCAN;  

H.H. 透過指定取樣百分比來建立統計資料Create statistics by specifying the sample percentage

下列範例會根據掃描 CustomerStatsSampleScan 資料表中 50% 的資料列來建立 DimCustomer 統計資料。The following example creates the CustomerStatsSampleScan statistics, based on scanning 50 percent of the rows in the DimCustomer table.

CREATE STATISTICS CustomerStatsSampleScan 
ON DimCustomer (CustomerKey, EmailAddress) WITH SAMPLE 50 PERCENT;  

另請參閱See Also

統計資料 Statistics
UPDATE STATISTICS (Transact-SQL) UPDATE STATISTICS (Transact-SQL)
sp_updatestats (Transact-SQL) sp_updatestats (Transact-SQL)
DBCC SHOW_STATISTICS (Transact-SQL) DBCC SHOW_STATISTICS (Transact-SQL)
DROP STATISTICS (Transact-SQL) DROP STATISTICS (Transact-SQL)
sys.stats (Transact-SQL) sys.stats (Transact-SQL)
sys.stats_columns (Transact-SQL)sys.stats_columns (Transact-SQL)