User Guide > Performance Tuning > Creating Cardinality Statistics for Cost-Based Optimization
 
Creating Cardinality Statistics for Cost-Based Optimization
The TDV SQL Query Engine might use statistics gathered from the data sources, when they are available, to create an efficient SQL query execution plan for joins or unions across tables, or to optimize caching. Statistics gathered on tables or views provide the SQL Query Engine with estimates on the table cardinality (the number of unique values or rows) so that optimizations can be applied.
By default, no statistics are gathered for any data source, and statistics storage tables must be created explicitly at the level of the data source to enable selected table and column scans.
Statistical data associated with a data source can be exported and imported with the data source, or you can just back up the configurations.
Any user with Access Tools and Modify All Resources rights, and with READ and WRITE privileges on a data source, can set up the gathering of cardinality statistics on the data source and one or more of its tables.
This section includes:
Creating Cardinality Statistics for a View
Creating Cardinality Statistics on a Data Source
You can consult the system data tables (/services/databases/system/SYS_STATISTICS) to see the status and the metadata (if you have the Read All Resources right) from both the data source and individual tables.