From 499082afcf5a2054a13ed331adf8d572787d0eaa Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tomas@2ndquadrant.com>
Date: Mon, 17 Jun 2024 15:07:09 +0200
Subject: [PATCH v20240617 08/56] review

---
 src/backend/optimizer/path/clausesel.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c
index 500a8858162..824a042c54a 100644
--- a/src/backend/optimizer/path/clausesel.c
+++ b/src/backend/optimizer/path/clausesel.c
@@ -220,6 +220,13 @@ clauselist_selectivity_ext(PlannerInfo *root,
 	 * estimatedclauses in statext_try_join_estimates is removed.
 	 *
 	 * XXX Maybe remove the comment and add an assert estimatedclauses==NULL.
+	 *
+	 * XXX I'm not sure removing the sjinfo is a good idea. Yes, the current
+	 * code does not actually use it (AFAICS), but selfuncs.c always passes
+	 * both jointype+sjinfo, so maybe we should do that too ... What happens
+	 * if we end up wanting to call an existing selfuncs function that needs
+	 * sjinfo in the future? Say because we want to call the regular join
+	 * estimator, and then apply some "correction" to the result?
 	 */
 	if (use_extended_stats && rel == NULL &&
 		statext_try_join_estimates(root, clauses, varRelid, jointype, sjinfo))
-- 
2.45.2

