Database vendors recently released AI functions that can be used in filter predicates. As such functions often rely on costly, black-box ML models, they unveil new data management challenges. Concretely, traditional data skipping techniques for integer and string data fail to be applicable to the new filter type. Indeed, there is no known mechanism for pruning non-qualifying row groups, e.g., when reading files from blob storage. In this work, we initiate the study of data skipping techniques for ML filters. We make the case that Parquet's default min-max metadata is enough to enable pruning. To this end, we draw connections to two lines of research: (i) the recently proposed query language for ML models and (ii) neural network verification. Our preliminary results on ReLU architectures show that on tables from TPC-H and TPC-DS, the average pruning effectiveness for filters of selectivity below 0.1% amounts to 27.4%. Finally, inspired by research on spatial joins, we propose an enhanced metadata structure: a size-bounded 2D convex hull that verification tools can make better use of, increasing the pruning effectiveness to 38.31%, while occupying at most 45 bytes per row group and column pair. We observe an end-to-end speedup of 1.07$\times$ over PyTorch in DuckDB.
翻译:[translated abstract in Chinese]
数据库厂商近期发布了可在过滤谓词中使用的AI函数。由于此类函数通常依赖成本高昂的黑盒ML模型,它们带来了新的数据管理挑战。具体而言,传统针对整数和字符串数据的数据跳过技术不再适用于新型过滤算子。例如,在从对象存储读取文件时,尚不存在可剪枝非合格行组的已知机制。本文首次系统研究ML过滤器的数据跳过技术。我们论证了Parquet默认的最小-最大元数据足以实现剪枝。为此,我们建立了两条研究线索的关联:(i) 近期提出的ML模型查询语言与(ii) 神经网络验证技术。针对ReLU架构的初步实验表明,在TPC-H和TPC-DS数据表上,对选择性低于0.1%的过滤器,平均剪枝有效率达27.4%。最后,受空间连接研究的启发,我们提出增强型元数据结构:有界二维凸包,验证工具可更充分利用该结构,将剪枝有效性提升至38.31%,同时每个行组-列对仅占用45字节。我们在DuckDB中观察到相比PyTorch的端到端加速比达1.07×。