Learned cardinality estimation methods have achieved high precision compared to traditional methods. Among learned methods, query-driven approaches face the data and workload drift problem for a long time. Although both query-driven and hybrid methods are proposed to avoid this problem, even the state-of-the-art of them suffer from high training and estimation costs, limited scalability, instability, and long-tailed distribution problem on high cardinality and high-dimensional tables, which seriously affects the practical application of learned cardinality estimators. In this paper, we prove that most of these problems are directly caused by the widely used progressive sampling. We solve this problem by introducing predicates information into the autoregressive model and propose Duet, a stable, efficient, and scalable hybrid method to estimate cardinality directly without sampling or any non-differentiable process, which can not only reduces the inference complexity from O(n) to O(1) compared to Naru and UAE but also achieve higher accuracy on high cardinality and high-dimensional tables. Experimental results show that Duet can achieve all the design goals above and be much more practical and even has a lower inference cost on CPU than that of most learned methods on GPU.
翻译:相较于传统方法,学习型基数估计方法已实现更高精度。其中,查询驱动方法长期面临数据与工作负载漂移问题。尽管已提出查询驱动与混合方法以规避该问题,但即使最优方案仍存在高训练与估计开销、可扩展性受限、稳定性不足以及高基数高维度表的长尾分布问题,严重制约学习型基数估计器的实际应用。本文证明上述问题大多由广泛使用的渐进采样直接导致。我们通过将谓词信息引入自回归模型解决该问题,提出Duet——一种稳定、高效且可扩展的混合方法,可在无需采样或任何不可微过程的情况下直接估计基数,相较Naru与UAE不仅将推理复杂度从O(n)降至O(1),更能在高基数高维度表上实现更高精度。实验结果表明,Duet能够实现上述全部设计目标,具有更强实用性,甚至在CPU上的推理成本低于多数学习型方法在GPU上的表现。