## 3.19.2.1  Statistics
Statistics help the query optimizer in choosing the right query plan. Missing statistics may prevent the query optimizer from selecting the optimal query plan.
When no statistics for an extended table are present, the query optimizer assumes the table size to be 1 million rows. If the actual table has significantly different number of rows, then the query plan chosen may not be optimal. To ensure that optimizer has the correct information, we recommend that you create statistics on the extended tables.
SAP HANA currently supports several types of statistics:
| HISTOGRAM   | Creates a data statistics object that helps the query optimizer estimate the data distribution in a single-column data source. If you specify multiple columns in <data_sources> , then multiple data statistics objects (HISTOGRAM) are created--one per column specified.                                                         |
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| SIMPLE      | Creates a data statistics object that helps the query optimizer calculate basic statistics, such as min, max, null count, count, and distinct count for a single-column data source. If you specify multiple columns in <data_sources> , then multiple data statistics objects are created--one per column specified.               |
| TOPK        | Creates a data statistics object that helps the query optimizer identify the highest-frequency values in a table data source. If you specify multiple columns in <data_sources> , then multiple data statistics objects are created--one per column specified.                                                                      |
| SKETCH      | Creates a data statistics object that helps the query optimizer estimate the number of distinct values in the data source. A data statistics object is created for the specified <table_name>(<column-name>,...) , which approximates the number of distinct tuples in the projection of the table on the set of specified columns. |
## SAMPLE
## RECORD COUNT
Creates a sample of data from &lt;data_source>= that the SQL optimizer can use during optimization. When beneficial, the SQL optimizer generates system SAMPLE data statistics objects automatically on column and row store tables. However, this behavior can incur a cost to performance. You can avoid this cost by creating SAMPLE data statistics objects explicitly (in advance). Creating them explicitly is especially useful in situations where sampling live table data is expensive (for example, very large tables).
Creates a data statistics object that helps the query optimizer calculate the number of records (rows) in a table data source. The RECORD COUNT type is a table-wide statistic. You do not specify columns in &lt;data_sources>= when creating a RECORD COUNT data statistics object. When beneficial, the SQL optimizer maintains system RECORD COUNT data statistics objects automatically on column and row store tables.
We recommend that simple statistics, at the very least, are present on key columns of extended tables.