# Region Merge Slow


![left](./student-guide/diagram/07-the-speed-of-Region-merge-is-slow-01-01.png)
------------------------------------------------------------
Handling of common problems
- Balance region scheduling is slow after capacity scale out
  - Observe if the PD Monitor Operator Panel generates an operator schedule and executes successfully
  - If no corresponding balance schedule is generated, further analysis is required. Possible reasons are:
    - The scheduler is not enabled, for example, the scheduler is removed, or the limit parameter is set to 0
    - Other constraints, such as the presence of evict-leader-scheduler or unreasonable label property setting, may cause some stores to fail to schedule leader or region
  - If the schedule is generating normally, but it's slow, you can try
    - View and adjust the store limit settings
    - Adjust region-schedule-limit appropriately according to business pressure
- Replication of a failed replica of a Store node is slow
  - Observe the build execution of the PD monitoring analysis operator
  - If no corresponding operator schedule is generated, there are possible reasons
    - Offline scheduling is turned off, or replica-schedule-limit is set to 0
    - Unable to find a node to move the region. If the capacity of the replacement node with the same label is greater than 80%, PD will stop scheduling in order to avoid the risk of explosion
  - If the schedule generates normally, it's just slow
    - Adjust replica-schedule-limit appropriately according to business pressure
    - Consider adding evict leader to the offline store
    - Observe if there is competition from other scheduling tasks, or if TiKV is under too much pressure
- Region merge is slow
  - Adjust the merge-schedule-limit appropriately, and adjust the max-merge-region-keys/max-merge-region-size parameters according to the situation to meet the merge threshold condition
  - Enable cross-table region merge        
    - 3.0 version
      - TiKV: split-region-on-table is set to false and needs to be restart to take effect
      - PD: namespace-classifier set to “” or “default”
    - 4.0 and later
      - TiKV: Set split-region-on-table to false, need to be restart to take effect
      - PD: key-type is set to txn or raw, or key-type is set to table and also set enable-cross-table-merge to true
  - Reduce the patrol-region-interval to speed up the inspection region
