Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 如何选择那些表需要从tikv同步到tiflash?
【TiDB Usage Environment】Production Environment
【TiDB Version】v5.4.1
【Encountered Problem】
I have 130 tables. Should I synchronize all 130 tables to TiFlash, or should I select certain tables to synchronize to TiFlash?
If the question is related to performance optimization or troubleshooting, please download the script and run it. Be sure to select all and copy-paste the terminal output results for upload.
According to the synchronization needs, TiFlash is a columnar storage. For tables where SQL queries can benefit from columnar storage to improve performance, set those tables accordingly.
If it is really difficult to distinguish, you can first synchronize all tables in the test environment, then run for a period of time to check the execution plan, and then only keep the replicas of the tables that use TiFlash.
Okay, thank you for the explanation.
Thank you for the explanation.
May I ask if the number of tables synchronized to TiFlash will affect TiFlash’s performance? For example, what is the impact on TiFlash’s performance when synchronizing 50 tables from TiKV to TiFlash compared to synchronizing 100 tables from TiKV to TiFlash?
You can try to find which statistical OLAP SQL queries require very few fields.
TiFlash, as a learner role, synchronizes data from TiKV. The more tables there are, the more resources will be consumed, especially in terms of network usage. The specific difference between having 50 and 100 tables needs to be measured in practice.
Tables that frequently require large-scale analytical queries
Got it! Thanks for the explanation.
Thank you for the explanation.
This indeed needs to be tested. It is indeed difficult to distinguish between OLAP and OLTP optimizers. Usually: 1. Some columns will be fully scanned 2. A small amount of data is returned to the client 3. The table has a large amount of data, which is suitable for placing in TiFlash.
Got it, thank you for the explanation.
Large tables, such as tables with hundreds of millions of rows; but if you only need to query a few fields from them, you can set up TiFlash for these.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.