From 2e44b2be201ae44cb8a19a78d0af94250f683f52 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Thu, 5 Sep 2024 00:47:51 +1200 Subject: [PATCH v4 3/3] Experiment with WindowAggState fields --- src/include/nodes/execnodes.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index add76b7eb5..627f99c13d 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -2619,6 +2619,17 @@ typedef struct WindowAggState bool inRangeAsc; /* use ASC sort order for in_range tests? */ bool inRangeNullsFirst; /* nulls sort first for in_range tests? */ + /* fields relating to runconditions */ + bool use_pass_through; /* When false, stop execution when + * runcondition is no longer true. Else + * just stop evaluating window funcs. */ + bool top_window; /* true if this is the top-most WindowAgg or + * the only WindowAgg in this query level */ + ExprState *runcondition; /* Condition which must remain true otherwise + * execution of the WindowAgg will finish or + * go into pass-through mode. NULL when there + * is no such condition. */ + /* these fields are used in GROUPS mode: */ int64 currentgroup; /* peer group # of current row in partition */ int64 frameheadgroup; /* peer group # of frame head row */ @@ -2631,16 +2642,6 @@ typedef struct WindowAggState MemoryContext curaggcontext; /* current aggregate's working data */ ExprContext *tmpcontext; /* short-term evaluation context */ - ExprState *runcondition; /* Condition which must remain true otherwise - * execution of the WindowAgg will finish or - * go into pass-through mode. NULL when there - * is no such condition. */ - - bool use_pass_through; /* When false, stop execution when - * runcondition is no longer true. Else - * just stop evaluating window funcs. */ - bool top_window; /* true if this is the top-most WindowAgg or - * the only WindowAgg in this query level */ bool all_first; /* true if the scan is starting */ bool partition_spooled; /* true if all tuples in current partition * have been spooled into tuplestore */ -- 2.34.1