# Introduction To Statistics

![left](./student-guide/diagram/18-introduction-01-01.png)

------------------------------------------------------------

During SQL execution, the execution plan tree is preprocessed, logically optimized, and physically optimized, and then output to the TiDB executor. At the same time as physical optimization, we need feedback from statistics. Statistics play an important role in the selection of indexes. We all know that indexes are better suited for queries with a small amount of data, and when a large number of rows are return, a full table scan may be a better choice. In these decisions, the optimizer uses feedback from statistics to decide whether to use an index scan.
