From 97cbc207ac20431b346614a47f04cd6f9468e4ef Mon Sep 17 00:00:00 2001 From: JmPotato Date: Fri, 24 Jul 2026 16:45:42 +0800 Subject: [PATCH] sessionctx: restore tidb_paging_size_bytes default to 0 Keep the Resource Control scope notes and the tested 4 MiB guidance so operators can still opt in explicitly, but leave byte-budget paging disabled by default. Signed-off-by: JmPotato --- pkg/sessionctx/vardef/tidb_vars.go | 14 ++++++++------ tests/integrationtest/r/sessionctx/setvar.result | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/sessionctx/vardef/tidb_vars.go b/pkg/sessionctx/vardef/tidb_vars.go index 9c35744217056..72208c820cc81 100644 --- a/pkg/sessionctx/vardef/tidb_vars.go +++ b/pkg/sessionctx/vardef/tidb_vars.go @@ -1519,13 +1519,15 @@ const ( DefInitChunkSize = 32 DefMinPagingSize = int(paging.MinPagingSize) DefMaxPagingSize = int(paging.MinAllowedMaxPagingSize) - // DefPagingSizeBytes defaults byte-budget paging to 4 MiB. It takes effect only when Resource Control - // is enabled and the active Resource Group is non-burstable (has limited burst). + // DefPagingSizeBytes defaults to 0 (byte-budget paging disabled). + // A non-zero value takes effect only when Resource Control is enabled and the active Resource Group + // is non-burstable (has limited burst). // Regression tests across cap-bound and under-cap TPC-C, FullScan, and Join workloads found no - // material performance regression. Among the tested 1, 2, 4, 8, and 16 MiB candidates, 4 MiB - // provided the best overall balance of throughput, tail latency, RU stability, RPC overhead, CPU, - // and RU efficiency. - DefPagingSizeBytes = 4 * 1024 * 1024 + // material performance regression with byte-budget paging. Among the tested 1, 2, 4, 8, and 16 MiB + // candidates, 4 MiB provided the best overall balance of throughput, tail latency, RU stability, + // RPC overhead, CPU, and RU efficiency. Consider setting this to 4 MiB (4194304) when enabling + // byte-budget paging for resource groups with limited burst. + DefPagingSizeBytes = 0 DefMaxChunkSize = 1024 DefDMLBatchSize = 0 DefMaxPreparedStmtCount = -1 diff --git a/tests/integrationtest/r/sessionctx/setvar.result b/tests/integrationtest/r/sessionctx/setvar.result index a64e073b9fa49..91a7cfd9be050 100644 --- a/tests/integrationtest/r/sessionctx/setvar.result +++ b/tests/integrationtest/r/sessionctx/setvar.result @@ -1102,11 +1102,11 @@ select /*+ set_var(tidb_paging_size_bytes=1048576) */ @@tidb_paging_size_bytes; 1048576 select @@tidb_paging_size_bytes; @@tidb_paging_size_bytes -4194304 +0 set @@tidb_paging_size_bytes=default; select @@tidb_paging_size_bytes; @@tidb_paging_size_bytes -4194304 +0 set @@tidb_paging_size_bytes=0; select @@tidb_paging_size_bytes; @@tidb_paging_size_bytes @@ -1118,7 +1118,7 @@ select @@tidb_paging_size_bytes; set @@tidb_paging_size_bytes=default; select @@tidb_paging_size_bytes; @@tidb_paging_size_bytes -4194304 +0 select /*+ set_var(tidb_enable_cascades_planner=0) */ @@tidb_enable_cascades_planner; @@tidb_enable_cascades_planner 0