RDB2G-Bench: A Comprehensive Benchmark for Automatic Graph Modeling of Relational Databases

Dongwon Choi, Sunwoo Kim, Juyeon Kim, Kyungho Kim, Geon Lee, Shinhwan Kang, Myunghwan Kim, Kijung Shin · DOI

TL;DR

This paper introduces RDB2G-Bench, the first comprehensive benchmark for evaluating how to best represent relational databases (RDBs) as graphs for machine learning tasks. They demonstrate that the way an RDB is converted into a graph significantly impacts performance, and their benchmark accelerates this evaluation process by 389x, enabling faster research into optimal RDB-to-graph modeling strategies.

What Problem Does This Paper Address?

Machine learning on relational databases (RDBs) is increasingly leveraging graph-based approaches. This involves transforming RDBs into graphs, where table rows become nodes and foreign-key relationships become edges. However, there are many ways to perform this "RDB-to-graph modeling," and the choice of graph representation can drastically affect the performance of downstream machine learning tasks. Identifying the optimal graph model is challenging and computationally expensive, as it often requires training graph neural networks (GNNs) repeatedly for each potential model. This paper addresses the need for a standardized, efficient way to evaluate and compare different RDB-to-graph modeling strategies.

Methods

The core contribution is the RDB2G-Bench framework. This benchmark consists of:

  • Precomputed Datasets: They created approximately 50,000 graph models from 5 real-world RDBs and 12 predictive tasks. For each graph model, they precomputed the performance metrics (accuracy, runtime, parameter size) of GNNs trained on it. This eliminates the need for researchers to retrain GNNs for every graph model they want to evaluate.
  • Benchmarking: They evaluated 10 different automatic RDB-to-graph modeling methods using their precomputed datasets.
  • Analysis: They analyzed the benchmark results to identify key factors influencing graph model effectiveness and provide practical insights.

The RDB-to-graph modeling process itself involves two main steps:

  1. Table and FK Selection: Deciding which tables and foreign key relationships to include in the graph.
  2. Row Representation: Deciding whether to represent table rows as nodes or edges.

Datasets

The paper introduces RDB2G-Bench, a new benchmark framework. It comprises:

  • 5 Real-World RDBs: These are sourced from the RelBench dataset.
  • 12 Predictive Tasks: Covering classification, regression, and recommendation tasks.
  • ~50,000 Graph Models: Generated from the RDBs, representing various combinations of table/FK selection and row representation (node vs. edge).
  • Precomputed Performance Metrics: For each of the ~50,000 graph models, they provide GNN performance metrics (training, validation, test performance, runtime, parameter size) across multiple trials.

This benchmark is designed to be significantly more efficient than on-the-fly evaluation, achieving an estimated 380x speedup.

Key Insights and Ideas

  • Graph Model Matters (A Lot): The way an RDB is converted into a graph is not a minor detail; it can lead to performance improvements of up to 10% compared to common heuristic methods. This highlights the importance of intelligent RDB-to-graph modeling.
  • No One-Size-Fits-All: There's no universal "best" way to model an RDB as a graph. The optimal approach depends heavily on the specific downstream task. What works for one task might degrade performance for another, even on the same RDB.
  • Simplicity Can Be Effective: Some straightforward methods, like greedy search algorithms, perform comparably to more complex approaches like Bayesian Optimization and Reinforcement Learning, especially under limited computational budgets.
  • Efficiency Gains are Huge: By precomputing results, RDB2G-Bench drastically reduces the time needed for benchmarking, making it feasible to explore a much larger space of graph models.
  • Common Substructures Exist: Top-performing graph models often share common structural patterns, suggesting that identifying these substructures could be a key to developing better modeling strategies.

Key Results

  • Performance Improvement: The best-performing graph models can yield up to a 5% performance gain over common heuristic rules (e.g., the AR2N method).
  • Benchmarking Speedup: RDB2G-Bench accelerates the evaluation of RDB-to-graph modeling methods by approximately 380x compared to on-the-fly evaluation.
  • Method Performance: The paper benchmarks 10 different RDB-to-graph modeling methods, showing that most actively searching methods outperform the fixed AR2N rule. Greedy Backward Search performed best under small budgets, while Bayesian Optimization excelled with larger budgets. LLM-based methods showed promise but struggled with long-term planning.

Limitations and Future Work

  • Graph Design Space Constraints: The current benchmark excludes some potential graph design choices, such as creating dummy tables or advanced feature engineering. Expanding this space is a direction for future work.
  • GNN Dependence: The benchmark provides precomputed evaluations for only four specific GNN architectures. While the authors believe their findings generalize, future work could include more GNNs.
  • Limited Task Coverage: Some tasks from the original RelBench dataset were excluded due to large graph design spaces and high computational costs. Expanding the dataset to cover more tasks is suggested.
  • Deeper GNNs: While a 2-layer GNN configuration was found to be efficient and effective, deeper GNNs might better exploit longer relational paths in complex schemas.
  • LLM Improvements: LLM-based methods showed potential but need improvement in devising effective long-term action plans. Chain-of-Thought reasoning showed slight improvements.

Summary updated

BibTeX
@misc{choi2025rdb,
  author = {Dongwon Choi and Sunwoo Kim and Juyeon Kim and Kyungho Kim and Geon Lee and Shinhwan Kang and Myunghwan Kim and Kijung Shin},
  title = {{RDB2G-Bench: A Comprehensive Benchmark for Automatic Graph Modeling of Relational Databases}},
  year = {2025},
  eprint = {2506.01360},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.01360},
}
Figure