Relational Deep Learning (RDL) is an effective approach to machine learning over multi-table relational databases. In RDL, a database is modeled as a graph in which each row is a node and each foreign-key relation is an edge, and a graph neural network (GNN) is trained on this graph. Training a GNN requires sampling a subgraph around every seed node in the training set, and the cost of training is largely determined by the size of these subgraphs. This paper aims to reduce subgraph size by leveraging the join and aggregation capabilities of relational database systems. We observe that sampled subgraphs are obtained by following metapaths composed of foreign-key links, and that many of these metapaths can be pruned without loss of accuracy. We present MetaSieve, a metapath selection layer that determines which metapaths to retain and which to prune. For each candidate metapath extension, MetaSieve computes statistics via SQL join and aggregation queries and evaluates the extension based on a novel scoring function that prefers lightweight but informative candidates. Metapaths whose scores fall below a threshold are deemed uninformative and pruned. Metapath selection in MetaSieve is lightweight since it relies only on database statistics and task labels, and it is independent of GNN parameters, so it integrates with diverse GNN architectures for classification and regression. Our evaluation on the RelBench benchmark with multiple GNN backbones shows that MetaSieve consistently reduces per-epoch training time by large margins while maintaining and often improving accuracy.
Figures & tables
Figure 1. The MetaSieve pipeline. MetaSieve works as a metapath selection layer that plugs into the conventional RDL pipeline. MetaSieve provides sampling configurations to the subgraph sampler, which provides subgraphs for downstream GNN training.
Figure 2. Generating frontier tables across hops. The hop-0 frontier is initialized from the training seed nodes, and each later frontier is generated from its parent by one additional join. Thus, each child hop- h frontier reuses the already-materialized parent hop- (h−1) frontier. ts stands for timestamp.
Figure 3. Reduction of frontier tables to metapath statistics. In this example, s1 and s2 denote two seeds, each identified by (SeedId, timestamp) . Each colored bar represents one distinct reachable row belonging to s1 or s2 . By grouping the frontier rows by seed and applying COUNT(*) , we obtain the parent and child count used for log-count and log-rate.
Dataset
Task Name
GNN Architecture
Random
MPS-GNN
MetaSieve (ours)
Test ↑
Time/epoch ↓
Test ↑
Time/epoch ↓
Test ↑
Time/epoch ↓
rel-ratebeer
user-churn
HeteroGraphSAGE (3 hop)
0.923
1,397
0.949
332
0.951
160
HGT (3 hop)
0.875
3,781
0.894
1,010
0.875
721
RelGT (3 hop, k=50)
0.933
9,742
0.942
2,443
0.953
1,253
rel-ratebeer
beer-churn
HeteroGraphSAGE (3 hop)
0.784
3,103
0.814
1,554
0.785
518
HGT (3 hop)
0.740
11,181
0.719
5,823
0.725
1,299
Table 1. Node classification performance. Evaluation metric is AUCROC (higher is better). Epoch time is in seconds (lower is better). The fastest time/epoch is highlighted in green, and the best test metrics are in bold.
Dataset
Task Name
GNN Architecture
Random
MetaSieve (ours)
Test ↓
Time/epoch ↓
Test ↓
Time/epoch ↓
rel-ratebeer
user-count
HeteroGraphSAGE (3 hop)
7.991
890
7.651
220
HGT(3 hop)
12.431
3,740
14.447
736
RelGT (3 hop, k=50)
8.387
2,086
7.960
900
rel-trial
study-adverse
HeteroGraphSAGE (3 hop)
44.420
29
44.727
15
HGT (3 hop)
57.379
80
57.118
45
Table 2. Node regression performance. Evaluation metric is MAE (lower is better). Epoch time is in seconds (lower is better). The fastest time/epoch is highlighted in green, and the best test metrics are in bold.
Dataset
Task Name
Train Samples
Batch Count
SQL Workers
SQL Time
Total Time
Seconds
Epochs
rel-ratebeer
user-churn
300,000
32
4
638
649
0.07
beer-churn
300,000
32
4
2318
2340
0.13
user-count
300,000
32
4
652
669
0.32
rel-trial
study-outcome
11,994
8
8
5
10
0.07
study-adverse
43,335
8
8
11
17
0.04
Table 3. Time for MetaSieve to complete preprocessing and generate the required sampling configuration (hops = 3 for all tasks). SQL Time is in seconds. Total Time is reported in seconds, and as a fraction of the epoch time for RelGT with random neighborhood sampling for the same task.
Dataset
Task Name
Train Samples
Val Samples
Config ( k=3 , beam_width=6)
Config ( k=6 , beam_width=15)
Total Time
Paths Evaluated
Total Time
Paths Evaluated
Seconds
Epochs
Seconds
Epochs
rel-ratebeer
user-churn
500
120
3,532
0.27
22
3,790
0.39
30
beer-churn
500
120
7,922
0.45
26
11,257
0.64
51
rel-trial
study-outcome
720
192
6,573
45.02
19
10,126
69.36
56
rel-f1
driver-dnf
720
192
9,268
14.85
29
11,606
18.60
33
Table 4. MPS-GNN search through hop 3 under the default ( k=3 , beam_width=6) configuration and an alternative ( k=6 , beam_width=15) configuration that produces more than 30 paths. Total Time is reported in seconds and as a multiple of the RelGT epoch time with random sampling. Paths Evaluated reports the number of metapaths evaluated during search.
Dataset
Task Name
GNN Architecture
MPS-GNN (top 20)
MPS-GNN (top 30)
MetaSieve
Test ↑
Time/epoch ↓
Test ↑
Time/epoch ↓
Test ↑
Time/epoch ↓
rel-ratebeer
user-churn
RelGT (3 hop, k=50)
0.942
2,443
0.933
6,132
0.953
1,253
rel-ratebeer
beer-churn
RelGT (3 hop, k=50)
0.780
11,102
0.793
14,070
0.799
1,494
rel-trial
study-outcome
RelGT (3 hop, k=100)
0.676
119
0.705
137
0.702
97
rel-f1
driver-dnf
RelGT (3 hop, k=100)
0.681
331
0.774
528
0.736
115
rel-f1
driver-top3
RelGT (3 hop, k=100)
0.750
123
0.744
124
0.819
32
Table 5. Node classification performance when MPS-GNN retains the top 20 and top 30 paths compared with MetaSieve. Evaluation metric is AUCROC (higher is better). Epoch time is in seconds (lower is better). The fastest time/epoch is highlighted in green, and the best test metrics are in bold.
Dataset
Task Name
MetaSieve
Random Pruning
Test
Time/ epoch
Test
Time/ epoch
rel-trial
study-outcome (cls ↑ )
0.702
97
0.675
162
study-adverse (reg ↓ )
44.984
225
46.566
345
site-success (reg ↓ )
0.369
744
0.447
1,527
rel-f1
driver-dnf (cls ↑ )
0.736
115
0.703
149
driver-top3 (cls ↑ )
0.766
29
0.795
31
Table 6. MetaSieve vs. random pruning using the same number of pruning rules starting from hop 2. All experiments use the RelGT backbone. For classification tasks (cls ↑ ), the test metric is AUCROC. For regression tasks (reg ↓ ), the test metric is MAE. Time/epoch is in seconds.
Dataset
Task Name
MetaSieve Formula
Only Count
Only Rate
Only Coverage
Test
Time/epoch
Test
Time/epoch
Test
Time/epoch
Test
Time/epoch
rel-trial
study-outcome (cls ↑ )
0.702
97
0.678
94
0.686
95
0.675
97
study-adverse (reg ↓ )
44.984
225
45.464
216
45.759
224
45.967
218
site-success (reg ↓ )
0.369
744
0.386
663
0.374
679
0.440
1,386
rel-f1
driver-dnf (cls ↑ )
0.736
115
0.726
182
0.706
109
0.699
99
driver-top3 (cls ↑ )
0.766
29
0.675
45
0.800
39
0.728
29
Table 7. Effect of different components of the formula for Q . All experiments use the RelGT backbone. For classification tasks (cls ↑ ), the test metric is AUCROC. For regression tasks (reg ↓ ), the test metric is MAE. Time/epoch is in seconds.
Dataset
Task Name
δ=0.10
δ=0.20
δ=0.30
δ=0.40
Selected δ
Val
Time/epoch
Val
Time/epoch
Val
Time/epoch
Val
Time/epoch
rel-trial
study-outcome (cls ↑ )
0.670
109
0.670
108
0.647
97
0.665
97
0.40
study-adverse (reg ↓ )
47.486
225
47.878
222
47.685
225
47.534
225
0.40
site-success (reg ↓ )
0.379
743
0.369
744
0.382
732
0.380
1,547
0.20
rel-f1
driver-dnf (cls ↑ )
0.769
100
0.750
111
0.763
116
0.782
115
0.40
driver-top3 (cls ↑ )
0.741
55
0.856
30
0.881
29
0.820
32
0.30
Table 8. Validation performance for different tasks across a range of values of hyperparameter δ . All experiments use the RelGT backbone. For classification tasks (cls ↑ ), the metric is AUCROC. For regression tasks (reg ↓ ), the metric is MAE.
Dataset
Task Name
GNN Architecture
Hop
Default Heuristic
Majority Heuristic
Unanimous Heuristic
Test
Time/epoch ↓
No. of Rules
Test
Time/epoch ↓
No. of Rules
Test
Time/epoch ↓
No. of Rules
rel-f1
driver-dnf (cls ↑ )
RelGT (k=100)
3
0.736
115
10
0.701
189
7
0.701
189
7
rel-f1
driver-position (reg ↓ )
RelGT (k=100)
3
4.110
84
11
4.005
134
7
4.005
134
7
rel-stack
user-badge (cls ↑ )
HeteroGraphSAGE
4
0.889
185
129
0.890
207
122
0.890
236
58
rel-stack
user-badge (cls ↑ )
RelGT (k=50)
3
0.877
3,063
23
0.877
3,063
23
0.901
3,508
1
rel-stack
user-engagement (cls ↑ )
HeteroGraphSAGE
4
0.906
209
172
0.907
214
166
0.907
217
151
Table 9. Performance under different heuristics for generating sampling rules. For classification tasks (cls ↑ ), the test metric is AUCROC. For regression tasks (reg ↓ ), the test metric is MAE. Time/epoch is in seconds. The number of pruning rules decreases as the heuristic becomes less aggressive in recommending pruning.
Dataset/Task Name
Workers
Batches
# Cand.
Task Frontier Rows
Peak Child Rows
Concurrent Peak Child Rows
Global Peak RSS (GB)
Wall-Clock Time (s)
rel-ratebeer/beer-churn
4
32
65
124.13B
5.28B
16.73B
1,040.22
1,436
rel-ratebeer/user-churn
4
32
51
51.51B
3.59B
13.25B
630.45
471
rel-avito/user-visits
4
16
23
25.67B
878.28M
3.34B
280.34
155
rel-avito/user-clicks
4
16
23
21.85B
758.26M
2.92B
233.91
135
rel-stack/post-votes
8
32
277
13.02B
153.23M
581.94M
147.65
168
rel-stack/user-badge
8
32
90
252.45M
7.38M
9.14M
12.77
31
Table 10. Frontier materialization and memory pressure under multi-worker execution. Task Frontier Rows is the total materialized volume, Peak Child Rows is the largest single frontier, and Concurrent Peak Child Rows is the largest combined frontier size of concurrently active queries. Global Peak RSS is the maximum sampled process RSS, and Wall-Clock Time is the end-to-end runtime. M and B denote million and billion rows.
Figure 4. Memory pressure of materializing a single frontier. Each point represents a candidate extension for a task. The x-axis represents the largest frontier table generated for this candidate extension. The y-axis is the peak RSS increase for the SQL query that generated this largest frontier table. Both axes use a log scale.
Dataset/Task Name
Workers
Batches
Concurrent Peak Child Rows
Global Peak RSS (GB)
Wall-Clock Time (s)
rel-ratebeer/beer-churn
4
32
16.73B
1,040.22
1,436
rel-ratebeer/beer-churn
3
32
13.87B
918.35
1,803
rel-ratebeer/beer-churn
2
32
10.34B
697.91
2,598
rel-ratebeer/user-churn
6
32
20.04B
974.21
390
rel-ratebeer/user-churn
5
32
16.61B
801.63
420
rel-ratebeer/user-churn
4
32
13.25B
630.45
471
Table 11. Effect of reducing worker count on memory. Reducing the number of workers reduces memory pressure but increases wall-clock time. B denotes billion rows.
Dataset/Task Name
Workers
Batches
Concurrent Peak Child Rows
Global Peak RSS (GB)
Wall-Clock Time (s)
rel-ratebeer/beer-churn
4
32
16.73B
1,040.22
1,436
rel-ratebeer/beer-churn
4
48
12.77B
792.60
1,420
rel-ratebeer/beer-churn
4
64
10.34B
637.47
1,427
rel-ratebeer/user-churn
6
32
20.04B
974.21
390
rel-ratebeer/user-churn
6
48
13.25B
613.54
397
rel-ratebeer/user-churn
6
64
10.17B
451.60
375
Table 12. Effect of increasing batch count on memory. More batches place fewer seeds in each batch, reducing memory pressure. B denotes billion rows.
Dataset/Task Name
Workers
Mem Limit /Worker
Threads /Worker
Peak Spill (GB)
Global Peak RSS (GB)
Wall-Clock Time (s)
rel-ratebeer/beer-churn
4
default
8
10.64
1,040.22
1,436
rel-ratebeer/beer-churn
4
128 GB
8
375.25
520.33
1,335
rel-ratebeer/beer-churn
4
64 GB
4
489.83
272.80
1,608
rel-ratebeer/beer-churn
4
32 GB
2
504.13
142.15
2,253
rel-ratebeer/beer-churn
4
16 GB
2
544.30
76.81
2,150
rel-ratebeer/user-churn
6
default
8
0.00
974.21
390
Table 13. Effect of per-worker memory and thread limits on memory. A lower memory limit forces DuckDB to spill intermediate data to disk, substantially reducing Global Peak RSS while increasing disk usage and Wall-Clock Time. Peak Spill is the maximum sampled size of the temporary spill files.
Relational table learning has gained increasing attention with the widespread use of relational databases. Existing methods typically rely on deep GNN or HGNN stacks, leading to high computational costs and limited performance on large real-world databases. We propose MetaRTL, a two-stage framework for scalable and expressive relational table learning. In the first stage, MetaRTL obtains initial table embeddings via lightweight pre-training. In the second stage, it performs non-parametric message passing to derive meta-path features, which are then aggregated by an attention module, MetaAttn. By shifting computation from deep message passing to efficient meta-path aggregation, MetaRTL captures rich relational semantics while maintaining high efficiency. Experiments on 10 real-world datasets across 24 tasks demonstrate the effectiveness of the proposed method.
Ken Zhong, Weichen Li, Zheng Wang
School of Computer Science, Shanghai Jiao Tong University, Shanghai, China · Shanghai Key Laboratory of Integrated Administration Technologies for Information Security, Shanghai, China
Relational deep learning (RDL) converts relational databases (RDBs) into heterogeneous graphs, but graphs derived directly from database schemas are often not well suited for how graph neural networks (GNNs) perform relational reasoning. We study what makes a relational graph suitable for deep learning and show that schema-derived graphs suffer from two systematic failures: information overload and semantic fragmentation. Our empirical analysis reveals that the desired graph is not the raw schema, but a result of controlled structural adaptation. Performance depends on balancing two operations: mitigating information overload via filtering, and repairing semantic fragmentation via injection. Specifically, filtering serves as a bias-variance knob with non-monotonic effects, while injection improves performance only when it explicitly restores the relational dependencies missing from the original schema. Based on these findings, we develop an end-to-end structural optimizer that applies both operations to adapt relational graphs automatically. Across 26 tasks spanning classification, regression, and recommendation, the optimized graphs consistently improve accuracy while often reducing inference cost.
Yao Cheng, Siqiang Luo
Nanyang Technological University, College of Computing and Data Science, Singapore.
Predictive modeling over relational databases (RDBs) powers applications, yet remains challenging due to capturing both cross-table dependencies and complex feature interactions. Relational Deep Learning (RDL) methods automate feature engineering via message passing, while classical approaches like Deep Feature Synthesis (DFS) rely on predefined non-parametric aggregators. Despite performance gains, the comparative advantages of RDL over DFS and the design principles for selecting effective architectures remain poorly understood. We present a comprehensive study that unifies RDL and DFS in a shared design space and conducts architecture-centric searches across diverse RDB tasks. Our analysis yields three key findings: (1) RDL does not consistently outperform DFS, with performance being highly task-dependent; (2) no single architecture dominates across tasks, underscoring the need for task-aware model selection; and (3) validation accuracy is an unreliable guide for architecture choice. This search yields a model performance bank that links architecture configurations to their performance; leveraging this bank, we analyze the drivers of the RDL-DFS performance gap and introduce two task signals -- RDB task homophily and an affinity embedding that captures size, path, feature, and temporal structure -- whose correlation with the gap enables principled routing. Guided by these signals, we propose Relatron, a task embedding-based meta-selector that chooses between RDL and DFS and prunes the within-family search. Lightweight loss-landscape metrics further guard against brittle checkpoints by preferring flatter optima. In experiments, Relatron resolves the "more tuning, worse performance" effect and, in joint hyperparameter-architecture optimization, achieves up to 18.5% improvement over strong baselines with 10x lower cost than Fisher information-based alternatives.