From d7b5c071dd6af2b81a7042dc60295061c7230cdc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 17 Mar 2022 18:25:44 -0400 Subject: Don't bother to attach column name lists to RowExprs of named types. If a RowExpr is marked as returning a named composite type, we aren't going to consult its colnames list; we'll use the attribute names shown for the type in pg_attribute. Hence, skip storing that list, to save a few nanoseconds when copying the expression tree around. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us --- src/backend/optimizer/util/var.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/backend/optimizer/util') diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c index a0543b7f47b..2b44ef3e176 100644 --- a/src/backend/optimizer/util/var.c +++ b/src/backend/optimizer/util/var.c @@ -809,6 +809,7 @@ flatten_join_alias_vars_mutator(Node *node, rowexpr->args = fields; rowexpr->row_typeid = var->vartype; rowexpr->row_format = COERCE_IMPLICIT_CAST; + /* vartype will always be RECORDOID, so we always need colnames */ rowexpr->colnames = colnames; rowexpr->location = var->location; -- cgit v1.2.3