# Tiflash Key Features: Engine Smart Selection
__*TiFlash engine smart selection*__

![left](./student-guide/diagram/TiFlashSmartSelection_aa_001_20220513.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 in the picture.

Since the product table does not take any columns, 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 read the index in TiKV to filter out the data of the product table that meets the condition.

The sales table takes the price column for aggregation (AVG), and there is no filter condition, which is equivalent to a large table scan, so it is more suitable for table scanning in TiFlash.
In the end, the 2 channels of data that meet the conditions are summarized on the TiDB Server to arrive at the results. 