# Tiflash Core Feature Smart Selection


![left](./student-guide/diagram/30-Intelligent-selection-01-01.png)
------------------------------------------------------------

As a coordinator, TiDB Server can evaluate based on SQL and automatically choose whether to execute SQL on TiKV or TiFlash, or read from TiKV and TiFlash respectively. As shown below
Since the product table does not take any column, only the product.batch_id = 'B1328' condition is filtered, and there is an index (pid, batch_id) in the product table, so you can choose to do an index read in TiKV to filter out the data that meets the condition in the product table.
The sales table takes the price column as an aggregation (AVG). There is no filter condition, which is equivalent to a large table scan, so it is more suitable for table scanning in TiFlash.
Finally, the 2-way data that satisfies the conditions are summarized on the TiDB Server to arrive at the result.