Cardinality estimation is a cornerstone of cost-based optimizers (CBOs), yet real-world workloads often violate the assumptions behind static statistics, degrading decision stability and increasing plan flip rates. We empirically characterize failures caused by stale statistics, skew, join correlations, hidden distributions in bind variables, and sampling bias, and quantify the overhead and break-even points of hardware-accelerated measurement. We propose GACE (GPU-Assisted Cardinality Estimation), a hybrid auxiliary architecture that augments rather than replaces the optimizer. GACE selectively invokes GPU-based measurement only in risky intervals via a Risky Gate that detects estimation uncertainty, and a GPU Measurement Engine that performs high-speed probing with explicit cost accounting for the measurement itself. This design preserves low overhead in stable regions while improving plan stability and reducing tail latency (P99) in problematic scenarios.
翻译:基数估计是基于成本的优化器(CBOs)的基石,然而实际工作负载常常违反静态统计信息背后的假设,导致决策稳定性下降并增加计划翻转率。我们通过实证方法分析了由过时统计信息、数据偏斜、连接相关性、绑定变量中的隐藏分布以及采样偏差所导致的故障,并量化了硬件加速测量的开销与盈亏平衡点。我们提出了GACE(GPU辅助基数估计),一种增强而非替代优化器的混合辅助架构。GACE通过一个检测估计不确定性的风险门控和一个执行高速探测并明确核算测量本身成本的GPU测量引擎,仅在风险区间选择性地调用基于GPU的测量。该设计在稳定区域保持低开销,同时在问题场景中提升计划稳定性并降低尾部延迟(P99)。