Innovative learning based structures have recently been proposed to tackle index and cardinality estimation tasks, specifically learned indexes and data driven cardinality estimators. These structures exhibit excellent performance in capturing data distribution, making them promising for integration into AI driven database kernels. However, accurate estimation for corner case queries requires a large number of network parameters, resulting in higher computing resources on expensive GPUs and more storage overhead. Additionally, the separate implementation for CE and learned index result in a redundancy waste by storage of single table distribution twice. These present challenges for designing AI driven database kernels. As in real database scenarios, a compact kernel is necessary to process queries within a limited storage and time budget. Directly integrating these two AI approaches would result in a heavy and complex kernel due to a large number of network parameters and repeated storage of data distribution parameters. Our proposed CardIndex structure effectively killed two birds with one stone. It is a fast multidim learned index that also serves as a lightweight cardinality estimator with parameters scaled at the KB level. Due to its special structure and small parameter size, it can obtain both CDF and PDF information for tuples with an incredibly low latency of 1 to 10 microseconds. For tasks with low selectivity estimation, we did not increase the model's parameters to obtain fine grained point density. Instead, we fully utilized our structure's characteristics and proposed a hybrid estimation algorithm in providing fast and exact results.
翻译:近年来,创新性的学习型结构被提出用于解决索引与基数估计任务,具体表现为学习索引与数据驱动的基数估计器。这些结构在捕捉数据分布方面表现出色,有望集成到人工智能驱动的数据库内核中。然而,针对边缘查询的精确估计需要大量网络参数,导致昂贵GPU计算资源消耗增加与存储开销上升。此外,基数估计器与学习索引的独立实现会因两次存储单表分布参数而产生冗余浪费。这为设计AI驱动的数据库内核带来了挑战——实际数据库场景中,紧凑的内核需要在有限存储与时间预算内处理查询。直接整合两种AI方法将因海量网络参数与重复存储数据分布参数而导致内核臃肿复杂。我们提出的CardIndex结构有效实现了"一石二鸟":它既是快速的多维学习索引,又是一种轻量级基数估计器,参数规模控制在KB级别。凭借其特殊结构与极小参数量,该结构能以1至10微秒的超低延迟获取元组的累积分布函数(CDF)与概率密度函数(PDF)信息。针对选择性估计较低的任务,我们并未通过增加模型参数来获取细粒度点密度,而是充分利用结构特性提出混合估计算法,在快速性中兼顾精确结果。