Manuscript Offprint

arXiv:2610.41669

Supervised and LLM-Augmented Cardinality Estimation for Similarity Queries on Knowledge Graphs

Georgios Chatzigeorgakidis, Dimitrios Skoutas, Alkis Simitsis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

"This is the authors' version of the work. It is posted here for your personal use. Not for redistribution. The definitive version has been presented at Int. J. of Semantic Computing 2026."

Supervised and LLM-Augmented Cardinality Estimation for Similarity Queries on Knowledge Graphs

Georgios Chatzigeorgakidis, Dimitrios Skoutas, and Alkis Simitsis

Athena Research Center, Greece

gchatzi@athenarc.gr, dskoutas@athenarc.gr, alkis@athenarc.gr

Abstract

Over the past decades, query cardinality estimation on relational databases has been proven crucial, enabling the result size estimation of all sub-plans of each query. This allowed query optimizers to design efficient query plans, towards minimizing the query response time. Lately, knowledge graphs are being preferred over traditional databases in various applications, due to their ability to represent complex relationships and semantic meaning in a domain-specific context. In this work, we present a novel approach for supervised similarity-aware cardinality estimation on knowledge graphs that incorporates similarities into the model training process, thus treating them as first-class citizens. To this end, we present SCE-KG, a model that employs a novel encoding scheme for cardinality estimation, named SG_split. We further extend our approach by leveraging a Large Language Model (LLM) to generate training queries that resemble realistic user workloads, and show that combining LLM-generated and random walk samples consistently improves estimation accuracy on test workloads generated by two independent LLMs. Our experimental evaluation reveals that our approach outperforms the state-of-the-art techniques in terms of prediction error, achieving 40x and 37x improvement for star and chain queries, respectively (95th percentile), whereas its online overhead accounts for less than 0.05% of the average query execution time and less than 1% of the average query planning time, showing a sub-millisecond latency in all cases.

Keywords: cardinality estimation; knowledge graphs; similarity queries; machine learning; query optimization.

References (45)

  • WDBench: a wikidata graph query benchmark
  • Foundations of modern query languages for graph databases
  • RDF and property graphs interoperability: Status and issues
  • STHoles: A Multidimensional Workload-Aware Histogram
  • Pessimistic Cardinality Estimation: Tighter Upper Bounds for Intermediate Join Cardinalities
  • Supervised Cardinality Estimation for Similarity Queries on Knowledge Graphs
  • Predicting execution times of concurrent queries, 2016
  • LMKG: learned models for cardinality estimation in knowledge graphs
  • Independence is Good: Dependency-Based Histogram Synopses for High-Dimensional Data
  • End-biased Samples for Join Cardinality Estimation
  • Selectivity Estimation using Probabilistic Models
  • Selectivity estimators for multidimensional range queries over real attributes
  • A survey on knowledge graph-based recommender systems
  • LUBM: A benchmark for OWL knowledge base systems
  • Selectivity and cost estimation for joins based on random sampling
  • Cardinality estimation in DBMS: A comprehensive benchmark evaluation
  • Improved cardinality estimation by learning queries containment rates
  • DeepDB: Learn from data, not from queries! PVLDB, 13(7):992–1005, 2020
  • Knowledge graphs
  • Han, K. Choi, and J. Chong
  • Cardinality Estimation Done Right: Index-Based Join Sampling
  • Query optimization through the looking glass, and what we found running the Join Order Benchmark
  • Sampling from large graphs
  • Consistent selectivity estimation via maximum entropy
  • Recipes for semantic web dog food—the ESWC and ISWC metadata projects
  • Equi-Depth Histograms For Estimating Selectivity Factors For Multi-Dimensional Queries
  • Improved selectivity estimation by combining knowledge from sampling and synopses
  • Flow-Loss: Learning cardinality estimates that matter
  • Learning State Representations for Query Optimization with Deep Reinforcement Learning
  • Unifying Large Language Models and Knowledge Graphs: A Roadmap
  • Approximate query answering using histograms
  • Understanding cardinality estimation using entropy maximization
  • A design space for RDF data representations
  • The future is big graphs: a community view on graph processing systems
  • Learned cardinality estimation for similarity queries
  • Database optimizers in the era of learning
  • Lightweight graphical models for selectivity estimation without independence assumptions
  • A learned query optimizer for spatial join
  • Are we ready for learned cardinality estimation? PVLDB, 14(9):1640–1654, 2021
  • Monotonic cardinality estimation of similarity selection: A deep learning approach
  • Cardinality Estimation with Local Deep Learning Models
  • A unified deep model of learning from both data and queries for cardinality estimation
  • NeuroCard: One cardinality estimator for all tables
  • Deep unsupervised cardinality estimation
  • FLAT: fast, lightweight and accurate method for cardinality estimation