When there are multiple TiFlash replicas, why don't three queries execute simultaneously when running an SQL statement?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiflash多个副本时,执行sql语句不是3个同时进行查询?

| username: Jaimyjie

When TiFlash has 3 replicas, isn’t the SQL query executed simultaneously on all 3? I checked the dashboard monitoring information, and only one node’s CPU and memory usage increased.

| username: 啦啦啦啦啦 | Original post link

In theory, multiple replicas do not improve performance; they mainly provide high availability.

| username: xfworld | Original post link

TiFlash high availability, 2 replicas are enough.

Data will be reasonably distributed and scheduled through the MPP engine to improve execution capability (so computing resources are the most critical).

| username: Jaimyjie | Original post link

The performance relies solely on the performance of a single node.

| username: 啦啦啦啦啦 | Original post link

Multiple nodes can use the MPP architecture, but multiple replicas are useless.

| username: xfworld | Original post link

The understanding is incorrect. The MPP engine can optimize data partitioning according to the execution plan, reasonably distributing it to different nodes for computation…

Otherwise, how can parallel acceleration be achieved? Wouldn’t serialization just get slower and slower?

| username: wzf0072 | Original post link

TiFlash supports query execution in MPP mode, which introduces cross-node data exchange (data shuffle process) in computation. By default, TiDB’s optimizer automatically decides whether to use MPP mode.

| username: Jaimyjie | Original post link

Optimized and forced MPP enabled, but looking at the CPU and memory usage of each node, only one node reaches about 30%, while the others are less than 2%, so I’m confused.

| username: wzf0072 | Original post link

After forcibly enabling MPP, did the execution plan change?

| username: wzf0072 | Original post link

:+1: Enlightening

| username: Jaimyjie | Original post link

Changed it, the effect is the same. Will test version 6.1 tomorrow.

| username: Jaimyjie | Original post link

Tested in version 6.1, the load is distributed to each node, but not very evenly. Looking at the CPU and memory data, it is mainly concentrated on one node, while the other nodes only provide slight assistance.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.