From 97b2227a5222aa61c1638fa7168fdd64d288d48a Mon Sep 17 00:00:00 2001 From: Tender Wang Date: Thu, 16 Oct 2025 19:41:11 +0800 Subject: [PATCH] Remove some asserts. --- src/backend/optimizer/path/indxpath.c | 28 +-------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index edc6d2ac1d3..47bb24fcaa8 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -3313,8 +3313,6 @@ match_orclause_to_indexcol(PlannerInfo *root, bool haveNonConst = false; Index indexRelid = index->rel->relid; - Assert(IsA(orclause, BoolExpr)); - Assert(orclause->boolop == OR_EXPR); /* Ignore index if it doesn't support SAOP clauses */ if (!index->amsearcharray) @@ -3352,28 +3350,6 @@ match_orclause_to_indexcol(PlannerInfo *root, if (list_length(subClause->args) != 2) break; - /* - * The parameters below must match between sub-rinfo and its parent as - * make_restrictinfo() fills them with the same values, and further - * modifications are also the same for the whole subtree. However, - * still make a sanity check. - */ - Assert(subRinfo->is_pushed_down == rinfo->is_pushed_down); - Assert(subRinfo->is_clone == rinfo->is_clone); - Assert(subRinfo->security_level == rinfo->security_level); - Assert(bms_equal(subRinfo->incompatible_relids, rinfo->incompatible_relids)); - Assert(bms_equal(subRinfo->outer_relids, rinfo->outer_relids)); - - /* - * Also, check that required_relids in sub-rinfo is subset of parent's - * required_relids. - */ - Assert(bms_is_subset(subRinfo->required_relids, rinfo->required_relids)); - - /* Only the operator returning a boolean suit the transformation. */ - if (get_op_rettype(opno) != BOOLOID) - break; - /* * Check for clauses of the form: (indexkey operator constant) or * (constant operator indexkey). See match_clause_to_indexcol's notes @@ -3414,8 +3390,6 @@ match_orclause_to_indexcol(PlannerInfo *root, */ if (IsA(constExpr, RelabelType)) constExpr = (Node *) ((RelabelType *) constExpr)->arg; - if (IsA(indexExpr, RelabelType)) - indexExpr = (Node *) ((RelabelType *) indexExpr)->arg; /* Forbid transformation for composite types, records. */ if (type_is_rowtype(exprType(constExpr)) || @@ -3447,7 +3421,7 @@ match_orclause_to_indexcol(PlannerInfo *root, } else { - if (opno != matchOpno || + if (matchOpno != opno || inputcollid != subClause->inputcollid || consttype != exprType(constExpr)) break; -- 2.34.1