错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

VecCard: a learned cardinality estimator for predicate filtering queries on vector databases

  • Xiaofeng Zou,
  • Shengfa Wu,
  • Yanhao Wang,
  • Hui Li

摘要

Query optimizers select efficient execution plans to minimize query latency and resource consumption in database systems, where cardinality estimators serve as their core component. While learned cardinality estimators have achieved significant improvements in relational databases by optimizing multi-table joins, vector databases face fundamentally different challenges with complex single-table predicate filtering and approximate nearest neighbor queries. To address these issues, we propose VecCard, a learned cardinality estimation model tailored for predicate filtering workloads in vector databases. Specifically, we design a Tree-LSTM-based architecture that accurately predicts the cardinalities of predicate filter queries through hierarchical semantic modeling. To enable flexible adaptations in dynamic environments without costly full retraining, we introduce an elastic weight consolidation (EWC) based incremental learning mechanism that preserves essential knowledge while learning new data and query patterns. Experimental results on the open-source vector database, DingoDB, demonstrate that VecCard yields more accurate cardinality estimates than several state-of-the-art baselines. It also significantly improves the performance of the generated query execution plans when integrated with DingoDB’s native optimizer.