REVIEW 2 major objections 5 minor 52 references
PLANSIEVE: Real-time Suboptimal Query Plan Detection Through Incremental Refinements
T0 review · 2 major / 5 minor · reviewed 2026-08-10 · deepseek-v4-flash
Pith's one-line read PLANSIEVE claims it can identify suboptimal query plans during optimization, before execution, by comparing the estimated and true-cardinality orderings of subplans and refining estimates online.
desk verdict A credible offline classifier for suboptimal-plan detection, but the online evaluation appears to score training queries again—so the real-time claims need a held-out rerun before I'd trust them. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing object is the pair of position vectors ρ and ρ̂ for each join size k, encoding the relative order of subplans under true and estimated cardinalities, together with the query-level L1-error derived from those vectors. Subplans are featurized as one-hot join encodings, tokenized with a delimiter separating the true from the estimated order, and processed by a GPT-2-style transformer whose output is concatenated with the L1-error and passed to an MLP for binary classification. The Cardinality Collector supplies true cardinalities from a cache refined over time, and a third-party estimator provides surrogates on cache misses.
What would settle it
A direct test would take queries whose optimizer-chosen estimated order exactly matches the true-cardinality order for every join size, so L1-error is zero, yet whose plan is still suboptimal by the paper's P-error threshold; if PLANSIEVE labels them optimal, the claim that positional order plus L1-error captures suboptimality is refuted. The paper's own Reversed-TC experiment gives the complementary check: when order is inverted, accuracy should degrade and then recover as true cardinalities are cached, and failure to recover would falsify the incremental-refinement claim.
Extended reading notes
Core claim
The paper's central claim is that suboptimality of a query plan can be predicted in real time from the positional discrepancy between subplan orderings by estimated versus true cardinalities, without waiting for execution. For each join size k, subplans are sorted by true cardinalities Y to form position vector ρ and by estimated cardinalities to form ρ̂; the L1-error aggregates absolute positional differences, weighted toward smaller joins. A transformer reads the concatenated sequence of true-order tokens, a delimiter, and estimated-order tokens, and together with the L1-error an MLP classifies the plan as optimal or suboptimal. The paper claims the model transfers from offline training with true cardinalities to online operation using surrogate estimates, and that incremental caching of true cardinalities improves accuracy over time. Experiments report classification accuracy up to 88.7% for suboptimal-plan prediction.
Load-bearing premise
The load-bearing premise is that surrogate cardinalities, as progressively refined by cached true values, preserve enough of the true subplan ordering that a classifier trained on true-cardinality orderings still recognizes suboptimal plans; when surrogates are random or reversed, the paper itself reports suboptimal-plan accuracy dropping to 57.7% to 70%.
Editorial extensions
If this is right
- If a plan is flagged suboptimal during optimization, the optimizer can explore alternative plans, prefer physical operators less sensitive to cardinality errors, or trigger targeted estimate correction before execution.
- Accuracy improves as the system caches true cardinalities from executed queries: on JOB-LIGHT-SCALE overall accuracy moves from 93.15% with surrogates alone to 95.58% with true cardinalities only, and suboptimal-plan accuracy rises correspondingly.
- Starting with a better surrogate estimator yields better initial suboptimal-plan accuracy, but the paper reports that even random or reversed-order surrogates recover to the same accuracy ceiling once true cardinalities accumulate.
- On a distributionally different unseen workload, JOB-LIGHT-RANGES, suboptimal-plan prediction accuracy drops to 48% to 52.5%, indicating that significant workload shifts may require retraining or fine-tuning.
- PLANSIEVE's classifier consistently identifies suboptimal plans better than the L1-error decision-tree baseline, especially by reducing the false positives that would let bad plans run.
Reading between the lines
- The core idea suggests an optimizer could use PLANSIEVE's prediction not just as a flag but to rank candidate plans by their estimated-order divergence, making robust plan selection a classification-guided search rather than a one-shot binary warning.
- Because the model learns from relative order rather than absolute cardinality magnitudes, it may transfer across databases where absolute estimates differ but order structures are similar; this is testable but not claimed in the paper.
- The benchmark augmentation framework, described as a way to obtain balanced training data, could also serve as a general stress-test for other learned query components by generating selective variations of base queries.
- A natural extension is to measure end-to-end wall-clock savings when PLANSIEVE's flags trigger re-optimization or estimate correction, rather than stopping at classification accuracy.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes PLANSIEVE, a framework for detecting suboptimal query plans during query optimization rather than after execution. The core idea is to learn, with a transformer-based classifier, the relationship between (i) the discrepancy in the relative order of subplans sorted by estimated versus true cardinalities (encoded as position vectors plus the aggregate L1-error) and (ii) whether the optimizer's plan is suboptimal. A cardinality collector supplies surrogates from a third-party estimator and progressively replaces them with true cardinalities observed from execution. The paper evaluates on augmented JOB-LIGHT-SCALE and STATS-CEB-SCALE workloads, reporting high offline classification accuracy on held-out 30% and online accuracy up to 88.7% for suboptimal-plan detection across five simulated scenarios of surrogate/true cardinality mixing.
Significance. If the real-time detection claim holds, the work addresses a well-known pain point: existing suboptimality metrics such as L1-error and P-error require true cardinalities and are only usable post-execution. The position-vector framing is a natural and interesting extension of the authors' earlier L1-error work, and the cross-validated offline evaluation is a genuine strength: it uses a strict train/test split, compares against an L1-decision-tree baseline, reports confusion matrices with absolute counts, and includes an ablation of estimator quality (DeepDB, Rand-Est, Reversed-TC) and a generalization probe (JOB-LIGHT-RANGES). The public artifacts and explicit statement of the suboptimality threshold (c=1) also improve reproducibility. However, the central real-time claim rests on an online evaluation protocol that, as described, appears to include training queries, which materially weakens the support for generalization to unseen queries.
major comments (2)
- [Section 6.4, Figures 10 and 11] The online evaluation appears to use the full workloads, not the held-out 30% used in the offline phase. Section 6.3 states that each dataset is partitioned into 70% training and 30% testing, but Section 6.4 does not state that the online phase is restricted to the held-out portion. The confusion matrices in Figure 10 sum to 1,357 and those in Figure 11 sum to 2,380, which equal the total sizes of JOB-LIGHT-SCALE and STATS-CEB-SCALE. Since the model was trained on roughly 70% of these queries with true cardinalities, the online results, including the headline "up to 88.7% suboptimal-plan accuracy" in Table 3, are likely inflated by scoring queries seen during training. Please rerun the online protocol on the held-out 30% only (or explicitly report separate held-out online numbers) and state clearly which split each figure and table uses.
- [Section 6.4 and Section 3.2] The online experiments do not directly validate the incremental-refinement mechanism. The five scenarios (100%, 75%, 50%, 25%, 0% surrogates) apply a globally fixed mixture of surrogate and true cardinalities to all queries at once, rather than simulating a chronological stream in which the cache fills as queries execute and later queries benefit from earlier executions, as described in the workflow of Section 3.2. The observed accuracy trend is consistent with refinement, but it does not demonstrate that the cache-based incremental process achieves this improvement in a real workload order. A time-ordered or cache-filling evaluation, or an explicit statement that these are ablation scenarios rather than a temporal simulation, is needed to support the "incremental refinements" part of the central claim.
minor comments (5)
- [Table 2] The JOB-LIGHT-SCALE row lists 1,357 training queries, but Section 6.3.1 and the training confusion matrix show 949 training queries (731+177+10+31). The table should list 949 (70% of the total) and 408 for testing to match the text.
- [Throughout] The framework name is spelled inconsistently as both "PLANSIEVE" and "PLANSEIVE" (e.g., Sections 3.3, 3.4, and 6.3.3). Please standardize to one spelling.
- [Figure 3 and Section 2.2] The example query is referred to as "qry_68_9" in Section 2.2 but as "t_68_9" in the caption of Figure 3; these should be aligned.
- [Section 4.2] The formula for aggregating cardinalities in partial-match patterns is garbled ("NX 1 Yp = Yp1 + ..."). The notation should be cleaned up and the averaging formula stated unambiguously.
- [Section 6.5, Table 3] The text in Section 6.5 says Reversed-TC improves "from 70.8% to 85.5%" for JOB-LIGHT-SCALE, but Table 3 reports the lower bound as 70%. Please make the numbers consistent.
Circularity Check
Online phase re-scores the 70% training split, so the headline real-time accuracy is partly in-sample; offline held-out and cross-workload results still provide independent support.
-
fitted input called prediction
[Section 5.4.1/6.3 vs Section 6.4.1/6.4.2, Figures 10-11 and Table 3]
"Datasets are partitioned into 70% for training and 30% for testing, with model performance evaluated using confusion matrices (Figure 8, 9). During training, PLANSIEVE’s CM correctly identified 731 out of 949 queries as optimal (true positives) and 177 as suboptimal (true negatives). The confusion matrices depicted in Figure 10 provide a detailed breakdown of the model’s performance across these scenarios."
The offline protocol fixes a 70% training split (949 of 1,357 JOB-LIGHT-SCALE queries; 1,667 of 2,380 STATS-CEB-SCALE queries). The online confusion matrices in Figures 10 and 11 sum exactly to the full workload sizes (1,357 and 2,380), with no statement that the online evaluation is restricted to the held-out 30%. The model was fitted to true-cardinality representations of the training queries, so the 'online prediction' accuracy—including the Table 3 upper bound of 88.7% sub-optimal accuracy obtained in the True-Cardinality-Only scenario—partly scores training inputs. This makes the headline real-time prediction accuracy an in-sample fit statistic, not a purely out-of-sample prediction.
full rationale
PLANSIEVE is primarily a supervised classification framework, not a derivation. The model is trained offline on (ρ, ρ̂, L1-error) to predict a P-error-based suboptimality label; the label is not definitionally equal to the feature, and the model can fail, so the core training/evaluation loop is not circular. The main circularity concern is evaluation leakage: the paper's own offline protocol uses a 70/30 split, but the online confusion matrices sum to the full workload sizes, meaning the 'online' accuracy includes the training queries. Because the model was fitted to true-cardinality versions of those queries, the True-Cardinality-Only scenario and the Table 3 upper bounds are partly memorization. The paper does rely on the same authors' prior L1-error metric [22] to motivate the feature, but that is a normal self-citation; the held-out offline accuracy and JOB-LIGHT-RANGES generalization provide independent evidence, so the derivation does not reduce to the citation itself.
Assumptions & free parameters
free parameters (4)
- Suboptimality cost threshold c =
1
- L1-error join-size weighting =
not specified
- Model hyperparameters =
tuned per workload, not fully reported
- Workload augmentation parameters =
1,357 and 2,380 generated queries
assumptions (5)
- domain assumption The plan generated using true cardinalities is the optimal plan.
- domain assumption Relative order of subplan cardinalities, quantified by L1-error, is a reliable indicator of plan suboptimality.
- domain assumption Surrogate cardinalities from a third-party estimator are sufficiently independent of the DBMS's native estimates and preserve enough ordering information for online classification.
- ad hoc to paper Augmented queries generated by modifying selection predicates of template queries are representative of realistic workloads.
- domain assumption Optimizer cost estimates, not actual execution times, define suboptimality via P-error.
Cite this review
Pith. "Pith review of PLANSIEVE: Real-time Suboptimal Query Plan Detection Through Incremental Refinements." pith.science (2026). https://pith.science/paper/EOJ3Y2Y7
@misc{pith2026250116544,
author = {Pith},
title = {Pith review of: PLANSIEVE: Real-time Suboptimal Query Plan Detection Through Incremental Refinements},
year = {2026},
howpublished = {\url{https://pith.science/paper/EOJ3Y2Y7}},
note = {Machine review of arXiv:2501.16544}
}
read the original abstract
Cardinality estimation remains a fundamental challenge in query optimization, often resulting in sub-optimal execution plans and degraded performance. While errors in cardinality estimation are inevitable, existing methods for identifying sub-optimal plans -- such as metrics like Q-error, P-error, or L1-error -- are limited to post-execution analysis, requiring complete knowledge of true cardinalities and failing to prevent the execution of sub-optimal plans in real-time. This paper introduces PLANSIEVE, a novel framework that identifies sub-optimal plans during query optimization. PLANSIEVE operates by analyzing the relative order of sub-plans generated by the optimizer based on estimated and true cardinalities. It begins with surrogate cardinalities from any third-party estimator and incrementally refines these surrogates as the system processes more queries. Experimental results on the augmented JOB-LIGHT-SCALE and STATS-CEB-SCALE workloads demonstrate that PLANSIEVE achieves an accuracy of up to 88.7\% in predicting sub-optimal plans.
Figures
Figures from the paper (8 more)
Reference graph
Works this paper leans on
-
[1]
A. Aboulnaga and S. Chaudhuri. Self-tuning histograms: building histograms without looking at data. pages 181–192, 1999
work page 1999
-
[2]
B. Babcock and S. Chaudhuri. Towards a robust query optimizer: a principled and practical approach. InSIGMOD 2005, 2005
work page 2005
-
[3]
S. Babu, P. Bizarro, and D. DeWitt. Proactive re-optimization. In SIGMOD 2005, pages 107–118, 2005
work page 2005
-
[4]
R. Borovica-Gajic, G. Graefe, and A. Lee. Robust performance in database query processing. Dagstuhl Reports, 7:169–180, 2017
work page 2017
- [5]
-
[6]
W. Cai, M. Balazinska, and D. Suciu. Pessimistic Cardinality Estimation: Tighter Upper Bounds for Intermediate Join Cardinalities. In SIGMOD 2019, pages 18–35, 2019
work page 2019
-
[7]
S. Chaudhuri, V . Narasayya, and R. Ramamurthy. Exact cardinality query optimization for optimizer testing. PVLDB, 2009
work page 2009
-
[8]
F. Chu, J. Y . Halpern, and P. Seshadri. Least expected cost query optimization: an exercise in utility. PODS ’99, page 138–147, 1999
work page 1999
Show all 52 references
-
[9]
H. D, P. N. Darera, and J. R. Haritsa. On the production of anorexic plan diagrams. In VLDB 2007, pages 1081–1092, 2007
2007
-
[10]
H. D., P. N. Darera, and J. R. Haritsa. Identifying robust plans through plan diagram reduction. 1:1124–1140, 2008
2008
-
[11]
Dargahi Nobari and D
A. Dargahi Nobari and D. Rafiei. Dtt: An example-driven tabular transformer for joinability by leveraging large language models. ACM SIGMOD, 2024
2024
-
[12]
A. Dey, S. Bhaumik, H. D, and J. Haritsa. Efficiently approximating query optimizer plan diagrams. 1:1325–1336, 2008
2008
-
[13]
Dutt and J
A. Dutt and J. R. Haritsa. Plan bouquets: query processing without selectivity estimation. In SIGMOD 2014, pages 1039–1050, 2014
2014
-
[14]
A. Dutt, S. Neelam, and J. R. Haritsa. Quest: an exploratory approach to robust query processing. PVLDB 2014, 7:1585–1588, 2014
2014
-
[15]
Ergenc, F
B. Ergenc, F. Morvan, and A. Hameurlain. Robust placement of mobile relational operators for large scale distributed query optimization. In PDCAT 2007, pages 227–235
2007
-
[16]
Graefe, W
G. Graefe, W. Guy, H. A. Kuno, and G. Paullley. Robust query processing. Dagstuhl Reports, 2:1–15, 2012
2012
-
[17]
Y . Han, Z. Wu, P. Wu, R. Zhu, J. Yang, L. W. Tan, K. Zeng, G. Cong, Y . Qin, A. Pfadler, Z. Qian, J. Zhou, J. Li, and B. Cui. Cardinality estimation in dbms: A comprehensive benchmark evaluation. PVLDB, 15:752–765, 2021
2021
-
[18]
J. R. Haritsa. Robust query processing: Mission possible. pages 2072–2075, 2019
2019
-
[19]
Hertzschuch, C
A. Hertzschuch, C. Hartmann, D. Habich, and W. Lehner. Turbo-charging spj query plans with learned physical join operator selections. PVLDB, pages 2706–2718, jul 2022
2022
-
[20]
Hilprecht, A
B. Hilprecht, A. Schmidt, M. Kulessa, A. Molina, K. Kersting, and C. Binnig. DeepDB: Learn from Data, not from Queries! PVLDB, 13(7):992–1005, 2020
2020
-
[21]
Izenov, A
Y . Izenov, A. Datta, F. Rusu, and J. H. Shin. COMPASS: Online Sketch-based Query Optimization for In-Memory Databases. In SIGMOD 2021, pages 804–816
2021
-
[22]
Izenov, A
Y . Izenov, A. Datta, B. Tsan, and F. Rusu. Sub-optimal join order identification with l1-error. InSIGMOD 2024, 2024
2024
-
[23]
A. Kipf, T. Kipf, B. Radke, V . Leis, P. Boncz, and A. Kemper. Learned Cardinalities: Estimating Correlated Joins with Deep Learning. In CIDR 2019, 2019
2019
-
[24]
A. Kipf, D. V orona, J. Müller, T. Kipf, B. Radke, V . Leis, P. Boncz, T. Neumann, and A. Kemper. Estimating cardinalities with deep sketches. In SIGMOD 2019, pages 1937–1940, 2019
2019
-
[25]
V . Leis, A. Gubichev, A. Mirchev, P. Boncz, A. Kemper, and T. Neumann. How Good Are Query Optimizers, Really? PVLDB, 9:204–215, 2015
2015
-
[26]
V . Leis, B. Radke, A. Gubichev, A. Kemper, and T. Neumann. Cardinality Estimation Done Right: Index-Based Join Sampling. In CIDR 2017, 2017
2017
-
[27]
V . Leis, B. Radke, A. Gubichev, A. Mirchev, P. Boncz, A. Kemper, and T. Neumann. Query Optimization Through the Looking Glass, and What We Found Running the Join Order Benchmark. VLDB Journal, 27:643–668, 2018
2018
-
[28]
B. Li, Y . Lu, C. Wang, and S. Kandula. Q-error bounds of random uniform sampling for cardinality estimation. CoRR, arXiv:2108.02715, 2021
2021 arXiv
-
[29]
H. Liu, M. Xu, Z. Yu, V . Corvinelli, and C. Zuzarte. Cardinality Estimation Using Neural Networks. InCASCON 2015, pages 53–59
2015
-
[30]
Malik, R
T. Malik, R. C. Burns, and N. V . Chawla. A Black-Box Approach to Query Cardinality Estimation. InCIDR 2007, 2007
2007
-
[31]
Marcus, P
R. Marcus, P. Negi, H. Mao, N. Tatbul, M. Alizadeh, and T. Kraska. Bao: Making learned query optimization practical. In SIGMOD 2021, pages 1275–1288, 2021. 25 PLANSIEVE: Real-time Suboptimal Query Plan Detection Through Incremental RefinementsA PREPRINT
2021
-
[32]
Moerkotte, T
G. Moerkotte, T. Neumann, and G. Steidl. Preventing bad plans by bounding the impact of cardinality estimation errors. PVLDB, 2009
2009
-
[33]
Muller, G
M. Muller, G. Moerkotte, and O. Kolb. Improved Selectivity Estimation by Combining Knowledge from Sampling and Synopses. PVLDB, 9(11):1016–1028, 2018
2018
-
[34]
P. Negi, R. Marcus, A. Kipf, H. Mao, N. Tatbul, T. Kraska, and M. Alizadeh. Flow-Loss: Learning Cardinality Estimates That Matter. PVLDB, 14(11):2019–2032, 2021
2019
-
[35]
P. Negi, Z. Wu, A. Kipf, N. Tatbul, R. Marcus, S. Madden, T. Kraska, and M. Alizadeh. Robust query driven cardinality estimation under changing workloads. 16:1520–1533, 2023
2023
-
[36]
Ortiz, M
J. Ortiz, M. Balazinska, J. Gehrke, and S. Sathiya Keerthi. An Empirical Analysis of Deep Learning for Cardinality Estimation. CoRR, arXiv:1905.06425v2, 2019
1905 arXiv
-
[37]
Purandare, S
S. Purandare, S. Karthik, and J. Haritsa. Dimensionality reduction techniques for robust query processing. Technical report, 2018
2018
-
[38]
Reiner and M
S. Reiner and M. Grossniklaus. Sample-efficient cardinality estimation using geometric deep learning. Proc. VLDB Endowment, 2024
2024
-
[39]
Rusu and A
F. Rusu and A. Dobra. Statistical Analysis of Sketch Estimators. In SIGMOD 2007, pages 187–198, 2007
2007
-
[40]
Rusu and A
F. Rusu and A. Dobra. Sketches for Size of Join Estimation. TODS, 33(15), 2008
2008
-
[41]
P. G. Selinger, M. M. Astrahan, D. D. Chamberlain, R. A. Lorie, and T. G. Price. Access Path Selection in a Relational Database Management System. In SIGMOD 1979, pages 23–34, 1979
1979
-
[42]
Trummer, J
I. Trummer, J. Wang, D. Maram, S. Moseley, S. Jo, and J. Antonakakis. SkinnerDB: Regret-Bounded Query Evaluation via Reinforcement Learning. In SIGMOD 2019, pages 1153–1170, 2019
2019
-
[43]
B. Tsan, A. Datta, Y . Izenov, and F. Rusu. Approximate sketches. ACM SIGMOD, 2024
2024
-
[44]
Vaswani, N
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. u. Kaiser, and I. Polosukhin. Attention is all you need. In NeurIPS 2017, 2017
2017
-
[45]
Woltmann, C
L. Woltmann, C. Hartmann, M. Thiele, D. Habich, and W. Lehner. Cardinality Estimation with Local Deep Learning Models. In aiDM 2019, pages 1–8
2019
-
[46]
Wu and A
Z. Wu and A. Shaikhha. Bayescard: A unified bayesian framework for cardinality estimation. abs/2012.14743, 2020
2012 arXiv
-
[47]
H. Xiu, P. Agarwal, and J. Yang. Parqo: Penalty-aware robust query optimization. CoRR, arXiv:2406.01526v3, 2024
2024 arXiv
-
[48]
Z. Yang, A. Kamsetty, S. Luan, E. Liang, Y . Duan, X. Chen, and I. Stoica. NeuroCard: One Cardinality Estimator for All Tables. PVLDB, 14(1):61–73, 2021
2021
-
[49]
Z. Yang, E. Liang, A. Kamsetty, C. Wu, Y . Duan, X. Chen, P. Abbeel, J. M. Hellerstein, S. Krishnan, and I. Stoica. Deep unsupervised cardinality estimation. In VLDB 2019, volume 13, pages 279–292, 2019
2019
-
[50]
A. Datta. PLANSIEVE Code Repository. https://anonymous.4open.science/r/PLANSIEVE-7519/, 2024
2024
-
[51]
G. Rahn. Join Order Benchmark (JOB). https://github.com/gregrahn/join-order-benchmark , 2015
2015
-
[52]
www.postgresql.org, 2024
PostgreSQL. www.postgresql.org, 2024. 26
2024
Reviewed August 10, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.