public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tatsuo Ishii <[email protected]>
To: [email protected]
To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: Row pattern recognition
Date: Fri, 03 Jul 2026 21:13:09 +0900 (JST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAAAe_zChW=nM9J18wdF2wMa2KesFO53fkbVRudkJ_bstdxzfOQ@mail.gmail.com>
<[email protected]>
<[email protected]>
Hi Henson, Jian,
In v50-0006-tidy-plumbing.patch, the planner cost model seems slightly
changed. Before the cost was charged according to the number of
pattern variables in PATTERN clause. But now it is charged according
to the number of pattern variables in DEFINE clause. Maybe I missed
the discussion on the changing. Can you please explain the reason of
the change?
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -3231,30 +3231,18 @@ cost_windowagg(Path *path, PlannerInfo *root,
* so we'll just do this for now.
*
* Moreover, if row pattern recognition is used, we charge the DEFINE
- * expressions once per tuple for each variable that appears in PATTERN.
+ * expressions once per tuple for each DEFINE variable.
*/
if (winclause->rpPattern)
{
- List *pattern_vars;
QualCost defcosts;
- pattern_vars = collectPatternVariables(winclause->rpPattern);
-
- foreach_node(String, pv, pattern_vars)
+ foreach_node(TargetEntry, def, winclause->defineClause)
{
- char *ptname = strVal(pv);
-
- foreach_node(TargetEntry, def, winclause->defineClause)
- {
- if (!strcmp(ptname, def->resname))
- {
- cost_qual_eval_node(&defcosts, (Node *) def->expr, root);
- startup_cost += defcosts.startup;
- total_cost += defcosts.per_tuple * input_tuples;
- }
- }
+ cost_qual_eval_node(&defcosts, (Node *) def->expr, root);
+ startup_cost += defcosts.startup;
+ total_cost += defcosts.per_tuple * input_tuples;
}
Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
view thread (181+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Row pattern recognition
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox