Skip to content

TPCC 10 warehouse performance regression: 25% tpmC drop after commit 522224799 (prepared statement recompile fix) #25614

Closed

Description

@Ariznawlll

Summary

TPCC benchmark shows a 25% performance regression in tpmC for 10-warehouse workload after commit 522224799.

Bisect Result

Binary search successfully identified the first bad commit:

Field Value
First bad commit 522224799
Last good commit 3a8d66954
Test TPCC: warehouse=10, terminals=10
Baseline tpmC 6097.17
Bad commit tpmC 4568.1
Regression -25.08%
Threshold 25%

Regression Details

Iteration History

Iteration Commit Verdict tpmC Delta vs Baseline
suspect efe2379 bad 4261.7 -30.10%
1 25abedd bad 4405.96 -27.74%
2 0fcd615 good 6041.19 -0.92%
3 3a8d669 good 6047.22 -0.82%
4 5222247 bad 4483.84 -26.46%
5 5222247 bad 4568.1 -25.08% (confirmed)

Bad Commit Analysis

Commit: 522224799
PR: #25562
Author: Cao Kai
Date: 2026-07-10 10:06:39 UTC
Message: fix(frontend): force recompile on each prepared execute to prevent hang

Original Fix: Fixed prepared UPDATE...JOIN hanging on second execution through binary protocol (COM_STMT_EXECUTE). The fix forces recompilation of the scope tree on every prepared statement execution to avoid stale state in hashbuild operators.

Side Effect: The forced recompilation on every execution introduces significant overhead, causing a 25% performance drop in TPCC workloads which heavily use prepared statements.

Root Cause

The commit changed initExecuteStmtParam to always release and recreate the compiled scope tree (prepareStmt.compile) on every execution, even when no schema change is detected. This was necessary to fix the hang caused by stale operator state, but the recompilation overhead is too high for TPCC's high-frequency prepared statement execution pattern.

Impact

  • TPCC 10-warehouse: 6097.17 → 4568.1 tpmC (-25.08%)
  • Affected workload: Any workload using prepared statements with high frequency
  • Severity: High (S1) - significant performance regression in core benchmark

Expected Behavior

TPCC performance should remain within 5% of baseline after the prepared statement hang fix.

Suggested Fix

Optimize the scope tree recompilation to reduce overhead:

  1. Lightweight recompilation: Instead of full FreeOperator + Release + recreate, implement a lighter reset that only clears stale state (e.g., hashbuild ctr, dispatch channels) without full recompilation

  2. Selective recompilation: Only recompile when necessary (e.g., detect actual stale state rather than always recompiling)

  3. Cache optimization: Keep the compiled scope tree but add a fast path to reset only the problematic operators (hashbuild, dispatch)

  4. Alternative approach: Fix the root cause of stale state in hashbuild operators instead of forcing recompilation

Environment

  • Branch: main
  • Cluster: TKE, 3 CNs + 1 DN
  • CN memory limit: 55 GiB
  • Test duration: 5 minutes

Related

Activity

  1. added
    kind/bug
    severity/s1
    and removed
    severity/s1
    on Jul 11, 2026
  2. added theissue type on Jul 11, 2026
  3. added this to the MO-202607 milestone on Jul 11, 2026
  4. Ariznawlll commented on Jul 12, 2026

    @Ariznawlll
    CollaboratorAuthor

    恢复了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions