[Test Environment for TiDB]
[TiDB Version] V6.5.0
[Encountered Issue: Problem Description and Impact] Is it possible to create a TiFlash replica for a specific partition of a partitioned table? There is a scenario: Partitioned table A needs to use placement rules to store hot and cold data separately. Partitioned table A involves complex queries including joins and various analytical scenarios using “in”. We hope to use TiFlash for acceleration, but only for analyzing hot data.
It seems that specifying TiFlash replicas for individual partitions is not supported. However, if you specify it for the entire table, scanning a specific partition should not scan the TiFlash replicas of the cold data, right?
It’s still not working. I can only locate the data of the entire table, not the partitioned data. Or is there a way to move partitions from table A to A_history? That would work too.
With TiFlash, not being able to use EXCHANGE PARTITION is a bug. The corresponding issue has already been closed. The original issue mentioned that EXCHANGE PARTITION couldn’t be used when both tables had TiFlash replicas.
In your current situation, it might be that one table has a TiFlash replica and the other does not. I think you could consider creating a minimal reproducible SQL and submitting another issue to see if it helps.
To give you some confidence, I also submitted an issue before. It was resolved in about a week. Whether the open-source community is effective or not, experiencing it yourself is better than a thousand words.
After all, they are two different things. Once exchanged out, it becomes a single table. The original poster’s requirement is to create a TiFlash replica for a specific partition while retaining the partitioned table’s organizational structure.
Yes, there may not be a good solution at the moment. We can only settle for the next best thing, such as deleting partitions or using more resources to support TiFlash replicas for the two tables.