25#ifndef WINDOWS_INCLUDED
26#define WINDOWS_INCLUDED
325 const int reason_index =
static_cast<int>(reason);
343 const int reason_index =
static_cast<int>(reason);
354 const int from_index =
static_cast<int>(from_reason);
355 const int to_index =
static_cast<int>(to_reason);
796 while (o ==
nullptr && w !=
nullptr) {
821 while (w !=
nullptr) {
1035 bool partition_order);
1075 bool partition_order);
1457 bool expand_definition)
const;
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Definition: item_cmpfunc.h:140
A wrapper class which provides array bounds checking.
Definition: sql_array.h:47
This is used for segregating rows in groups (e.g.
Definition: item.h:6517
Helper class for copy_funcs(); represents an Item to copy from table to next tmp table.
Definition: temp_table_param.h:48
Class Item_sum is the base class used for special expressions that SQL calls 'set functions'.
Definition: item_sum.h:399
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Definition: sql_list.h:467
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:61
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
Parse tree node for a single of a window extent's borders, cf.
Definition: parse_tree_nodes.h:1376
Parse tree node for a window's frame, cf.
Definition: parse_tree_nodes.h:1464
Definition: parse_tree_nodes.h:233
Parse tree node for a window; just a shallow wrapper for class Window, q.v.
Definition: parse_tree_window.h:39
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1163
SQL_I_List< Table_ref > m_table_list
List of tables in FROM clause - use Table_ref::next_local to traverse.
Definition: sql_lex.h:1929
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Object containing parameters used when creating and using temporary tables.
Definition: temp_table_param.h:95
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:110
static bool equal_sort(Window *w1, Window *w2)
Return true of the physical[1] sort orderings for the two windows are the same, cf.
Definition: window.cc:738
int64 rowno_in_partition() const
See m_rowno_in_partition.
Definition: window.h:1339
Item_string *const m_inherit_from
<existing window name>
Definition: window.h:129
bool m_is_last_row_in_frame
Execution state: the current row is the last row in a window frame For some aggregate functions,...
Definition: window.h:656
bool m_row_optimizable
The functions are optimizable with ROW unit.
Definition: window.h:167
bool check_border_sanity2(THD *thd)
Like check_border_sanity1() but contains checks which must wait until the start of the execution phas...
Definition: window.cc:877
const bool m_is_reference
If true, m_name is an unbound window reference, other fields are unused.
Definition: window.h:134
bool needs_last_peer_in_frame() const
If we cannot compute one of window functions without looking at all rows in the peerset of the curren...
Definition: window.h:1107
void reset_order_by_peer_set()
Reset the current row's ORDER BY expressions when starting a new peer set.
Definition: window.cc:508
int64 last_rowno_in_range_frame() const
See m_last_rowno_in_range_frame.
Definition: window.h:1237
bool before_or_after_frame(bool before)
Common implementation of before_frame() and after_frame().
Definition: window.cc:541
void reset_all_wf_state()
Reset the execution state for all window functions defined on this window.
Definition: window.cc:1509
bool in_new_order_by_peer_set(bool compare_all_order_by_items=true)
Determine if the current row is not in the same peer set as the previous row.
Definition: window.cc:529
bool opt_last_row() const
See m_opt_last_row.
Definition: window.h:1143
int64 m_rowno_in_partition
Execution state: The row number of the current row being readied for output within the partition.
Definition: window.h:514
void set_last_rowno_in_range_frame(uint64 rno)
See m_last_rowno_in_range_frame.
Definition: window.h:1244
void set_def_pos(uint pos)
Definition: window.h:780
void apply_temp_table(THD *thd, const Func_ptr_array &items_to_copy, bool first)
Specify that this window is to be evaluated after a given temporary table.
Definition: window.cc:1530
Window & set_rowno_in_frame(int64 rowno)
See m_rowno_in_frame.
Definition: window.h:1331
int64 m_first_rowno_in_range_frame
Execution state: the row number of the first row in a frame when evaluating RANGE based frame bounds.
Definition: window.h:607
void reset_partition_state()
Reset window state for a new partition.
Definition: window.h:1429
Item_string * m_name
<window name>
Definition: window.h:122
Frame_buffer_position m_tmp_pos
Sometimes we read one row too many, so that the saved position will be too far out because we subsequ...
Definition: window.h:319
bool static_aggregates() const
Return true if the aggregates are static, i.e.
Definition: window.h:1133
int64 first_rowno_in_range_frame() const
See m_first_rowno_in_range_frame.
Definition: window.h:1367
bool after_frame()
Definition: window.h:940
int64 m_row_has_fields_in_out_table
If >=1: the row with this number (1-based, relative to start of partition) currently has its fields i...
Definition: window.h:434
void copy_pos(Window_retrieve_cached_row_reason from_reason, Window_retrieve_cached_row_reason to_reason)
Copy frame buffer position hint from one to another.
Definition: window.h:352
int64 m_frame_buffer_partition_offset
Execution state: Snapshot of m_frame_buffer_total_rows when we start a new partition,...
Definition: window.h:424
bool resolve_window_ordering(THD *thd, Ref_item_array ref_item_array, Table_ref *tables, mem_root_deque< Item * > *fields, ORDER *o, bool partition_order)
Resolve and set up the PARTITION BY or an ORDER BY list of a window.
Definition: window.cc:674
void restore_special_row(uint64 special_rowno, uchar *record)
Restore row special_rowno into record from in-memory copy.
Definition: window_iterators.cc:504
void set_row_has_fields_in_out_table(int64 rowno)
See m_row_has_fields_in_out_table.
Definition: window.h:1407
bool m_needs_peerset
(At least) one window function needs the peer set of the current row to evaluate the wf for the curre...
Definition: window.h:146
ORDER * m_sorting_order
merged partition/order by
Definition: window.h:120
const st_nth & opt_nth_row() const
See m_opt_nth_row.
Definition: window.h:1158
void set_first_rowno_in_range_frame(int64 rowno)
See m_first_rowno_in_range_frame.
Definition: window.h:1360
const Window * m_ancestor
resolved from existing window name
Definition: window.h:242
uint m_def_pos
Position of definition in query's text, 1 for leftmost.
Definition: window.h:128
Temp_table_param * m_frame_buffer_param
Execution state: used iff m_needs_frame_buffering.
Definition: window.h:395
const st_lead_lag & opt_lead_lag() const
See m_opt_lead_lag.
Definition: window.h:1163
bool aggregates_primed() const
See m_aggregates_primed.
Definition: window.h:1298
int64 row_has_fields_in_out_table() const
See m_row_has_fields_in_out_table.
Definition: window.h:1400
int64 m_is_last_row_in_peerset_within_frame
Execution state: used iff m_needs_last_peer_in_frame.
Definition: window.h:467
bool make_special_rows_cache(THD *thd, TABLE *out_tbl)
Allocate the cache for special rows.
Definition: window.cc:1322
size_t m_special_rows_cache_length[FBC_FIRST_KEY - FBC_LAST_KEY+1]
Length of each copy in m_special_rows_cache, in bytes.
Definition: window.h:446
void set_short_circuit(bool short_circuit)
Definition: window.h:1186
const PT_frame * frame() const
Get the frame, if any.
Definition: window.h:785
int64 m_part_row_number
Execution state: the current row number in the current partition.
Definition: window.h:475
PT_order_list *const m_order_by
<window order clause>
Definition: window.h:119
bool check_border_sanity1(THD *thd)
Check that frame borders are sane; resolution phase.
Definition: window.cc:804
int64 rowno_in_frame() const
Return the size of the frame in number of rows.
Definition: window.h:1326
static bool resolve_reference(THD *thd, Item_sum *wf, PT_window **m_window)
Resolve any named window to its definition and update m_window to point to the definition instead.
Definition: window.cc:429
void set_frame_buffer_param(Temp_table_param *p)
Setter for m_frame_buffer_param, q.v.
Definition: window.h:1173
bool short_circuit() const
Definition: window.h:1185
void set_frame_buffer(TABLE *tab)
Setter for m_frame_buffer, q.v.
Definition: window.h:1183
int64 frame_buffer_total_rows() const
See m_frame_buffer_total_rows.
Definition: window.h:1381
const PT_order_list * effective_partition_by() const
Get partition, if any.
Definition: window.h:818
Window(Item_string *name)
Reference to a named window.
Definition: window.h:738
bool needs_buffering() const
If we cannot compute one of window functions without looking at succeeding rows, return true,...
Definition: window.h:1093
int64 m_frame_buffer_total_rows
Execution state: The frame buffer tmp file is not truncated for each new partition.
Definition: window.h:417
bool check_window_functions2(THD *thd)
Like check_window_functions1() but contains checks which must wait until the start of the execution p...
Definition: window.cc:1277
bool m_do_copy_null
Execution state: make frame wf produce a NULL (or 0 depending, e.g.
Definition: window.h:664
bool m_opt_first_row
Window equires re-evaluation of the first row in optimized moving frame mode e.g.
Definition: window.h:188
bool m_inverse_aggregation
Execution state: do inverse, e.g.
Definition: window.h:671
bool m_range_optimizable
The functions are optimizable with RANGE unit.
Definition: window.h:175
bool m_static_aggregates
The aggregates (SUM, etc) can be evaluated once for a partition, since it is static,...
Definition: window.h:182
bool setup_ordering_cached_items(THD *thd, Query_block *select, const PT_order_list *o, bool partition_order)
Set up cached items for an partition or an order by list updating m_partition_items or m_order_by_ite...
Definition: window.cc:645
bool check_window_functions1(THD *thd, Query_block *select)
Check that the semantic requirements for window functions over this window are fulfilled,...
Definition: window.cc:122
Window(PT_order_list *partition_by, PT_order_list *order_by, PT_frame *frame)
Unnamed window.
Definition: window.h:745
static void eliminate_unused_objects(List< Window > *windows)
Check window definitions to remove unused windows.
Definition: window.cc:1026
bool check_unique_name(const List< Window > &windows)
Return true if this window's name is not unique in windows.
Definition: window.cc:630
ORDER * first_order_by() const
Get the first argument of the ORDER BY clause for this window if any.
Definition: window.cc:118
bool is_last_row_in_frame() const
See m_is_last_row_in_frame.
Definition: window.h:1308
void set_is_last_row_in_peerset_within_frame(bool value)
See m_is_last_row_in_peerset_within_frame.
Definition: window.h:1268
bool opt_first_row() const
See m_opt_first_row.
Definition: window.h:1138
bool m_needs_partition_cardinality
(At least) one window function needs the cardinality of the partition of the current row to evaluate ...
Definition: window.h:159
void set_name(Item_string *name)
We have a named window.
Definition: window.h:766
uchar * m_special_rows_cache
Holds a fixed number of copies of special rows; each copy can use up to m_special_rows_cache_max_leng...
Definition: window.h:444
static constexpr int FRAME_BUFFER_POSITIONS_CARD
Cardinality of m_frame_buffer_positions if no NTH_VALUE, LEAD/LAG.
Definition: window.h:258
static double compute_cost(double cost, const List< Window > &windows)
Compute sorting costs for windowing.
Definition: window.cc:1523
void set_is_last(bool last)
An override used by the hypergraph join optimizer only.
Definition: window.h:1153
int64 m_rowno_being_visited
Execution state: The number of the row being visited for its contribution to a window function,...
Definition: window.h:498
int64 first_rowno_in_rows_frame() const
Definition: window.h:1353
bool at_partition_border() const
Check if we have read all the rows in a partition, possibly having buffered them for further processi...
Definition: window.h:948
bool m_needs_last_peer_in_frame
(At least) one window function (currently JSON_OBJECTAGG) needs the last peer for the current row to ...
Definition: window.h:153
bool m_last
The last window to be evaluated at execution time.
Definition: window.h:199
void set_first_rowno_in_rows_frame(int64 rowno)
See m_first_rowno_in_rows_frame.
Definition: window.h:1349
const PT_order_list * effective_order_by() const
Get the ORDER BY, if any.
Definition: window.h:792
int64 m_rowno_in_frame
Execution state: the row number of the row we are looking at for evaluating its contribution to some ...
Definition: window.h:507
bool m_aggregates_primed
Execution state: for optimizable aggregates, cf.
Definition: window.h:522
Window(PT_order_list *partition_by, PT_order_list *order_by, PT_frame *frame, Item_string *inherit)
Unnamed window based on a named window.
Definition: window.h:752
Mem_root_array< Cached_item * > m_order_by_items
items for the ORDER BY exprs.
Definition: window.h:247
void set_ancestor(Window *a)
After resolving an existing window name reference in a window definition, we set the ancestor pointer...
Definition: window.h:772
void set_last_row_output(int64 rno)
See m_last_row_output.
Definition: window.h:1212
void save_special_row(uint64 special_rowno, TABLE *t)
Save row special_rowno in table t->record[0] to an in-memory copy for later restoration.
Definition: window_iterators.cc:486
int64 is_last_row_in_peerset_within_frame() const
See m_is_last_row_in_peerset_within_frame.
Definition: window.h:1261
bool needs_sorting() const
Determine if the window had either a partition clause (inclusive) or a ORDER BY clause,...
Definition: window.h:1087
st_lead_lag m_opt_lead_lag
Definition: window.h:239
bool before_frame()
While processing buffered rows in RANGE frame mode we, determine if the present row revisited from th...
Definition: window.h:937
void save_pos(Window_retrieve_cached_row_reason reason)
See m_tmp_pos.
Definition: window.h:324
int64 last_row_output() const
See m_last_row_output.
Definition: window.h:1207
bool setup_range_expressions(THD *thd)
For RANGE frames we need to do computations involving add/subtract and less than, smaller than.
Definition: window.cc:241
bool m_short_circuit
Holds whether this window should be “short-circuit”, ie., goes directly to the query output instead o...
Definition: window.h:401
void set_last_rowno_in_peerset(uint64 rno)
See m_last_rowno_in_peerset.
Definition: window.h:1256
Item_string * name() const
Get the name of a window.
Definition: window.h:777
int64 partition_rowno() const
Getter for m_part_row_number, q.v., the current row number within the partition.
Definition: window.h:1194
Query_block * m_query_block
The SELECT the window is on.
Definition: window.h:117
void reset_execution_state(Reset_level level)
Common function for all types of resetting.
Definition: window.cc:1373
ORDER * first_partition_by() const
Get the first argument of the PARTITION clause for this window if any.
Definition: window.cc:114
bool do_inverse() const
See m_inverse_aggregation.
Definition: window.h:1285
int64 m_first_rowno_in_rows_frame
Execution state.
Definition: window.h:625
void destroy()
Free structures that were set up during preparation of window functions.
Definition: window.cc:1352
static bool setup_windows1(THD *thd, Query_block *select, Ref_item_array ref_item_array, Table_ref *tables, mem_root_deque< Item * > *fields, List< Window > *windows)
Semantic checking of windows.
Definition: window.cc:1092
void set_rowno_being_visited(int64 rno)
See m_rowno_being_visited.
Definition: window.h:1222
size_t m_special_rows_cache_max_length
Maximum allocated size in m_special_rows_cache.
Definition: window.h:448
TABLE * frame_buffer() const
Getter for m_frame_buffer, q.v.
Definition: window.h:1178
const char * printable_name() const
Definition: window.cc:1502
TABLE * m_frame_buffer
Execution state: used iff m_needs_frame_buffering.
Definition: window.h:407
bool do_copy_null() const
See m_do_copy_null.
Definition: window.h:1275
Window & set_inverse(bool b)
See m_inverse_aggregation.
Definition: window.h:1290
void cleanup()
Free up any resource used to process the window functions of this window, e.g.
Definition: window.cc:1337
bool is_reference() const
Return if this window represents an unresolved window reference seen in a window function OVER clause...
Definition: window.h:892
bool m_partition_border
Execution state: the current row starts a new partition.
Definition: window.h:481
List< Item_sum > & functions()
Get the list of functions invoked on this window.
Definition: window.h:847
int64 m_last_rowno_in_peerset
Execution state: used iff m_needs_peerset.
Definition: window.h:461
void set_last_rowno_in_cache(uint64 rno)
See m_last_rowno_in_cache.
Definition: window.h:1232
void reset_lead_lag()
Reset execution state for LEAD/LAG for the current row in partition.
Definition: window.cc:1364
Temp_table_param * frame_buffer_param() const
Getter for m_frame_buffer_param, q.v.
Definition: window.h:1168
void reset_round()
Reset execution state for next call to JOIN::exec, cf.
Definition: window.h:1435
void set_frame_buffer_partition_offset(int64 offset)
See m_frame_buffer_partition_offset.
Definition: window.h:1386
int64 last_rowno_in_peerset() const
See m_last_rowno_in_peerset.
Definition: window.h:1251
bool optimizable_row_aggregates() const
Return true if the set of window functions are all ROW unit optimizable.
Definition: window.h:1121
Mem_root_array_YY< Frame_buffer_position > m_frame_buffer_positions
Execution state: used iff m_needs_frame_buffering.
Definition: window.h:310
int m_ordering_idx
The logical ordering index (into LogicalOrderings) needed by this window's PARTITION BY and ORDER BY ...
Definition: window.h:583
bool check_constant_bound(THD *thd, PT_border *border)
Check that a frame border is constant during execution and that it does not contain subqueries (relev...
Definition: window.cc:774
bool m_needs_frame_buffering
(At least) one window function needs to buffer frame rows for evaluation i.e.
Definition: window.h:140
bool is_last() const
See m_last.
Definition: window.h:1148
int64 m_last_rowno_in_cache
Execution state: used iff m_needs_frame_buffering.
Definition: window.h:455
Special_keys
Keys for m_special_rows_cache, for special rows (see the comment on m_special_row_cache).
Definition: window.h:376
@ FBC_LAST_KEY
Definition: window.h:387
@ FBC_FIRST_KEY
Definition: window.h:386
@ FBC_FIRST_IN_NEXT_PARTITION
We read an incoming row.
Definition: window.h:383
void print_frame(const THD *thd, String *str, enum_query_type qt) const
Definition: window.cc:1455
bool needs_peerset() const
If we cannot compute one of window functions without looking at all rows in the peerset of the curren...
Definition: window.h:1100
Reset_level
Definition: window.h:1443
@ RL_ROUND
Definition: window.h:1443
@ RL_PARTITION
Definition: window.h:1443
bool m_mark
Used temporarily by the hypergraph join optimizer to mark which windows are referred to by a given or...
Definition: window.h:590
Mem_root_array< Cached_item * > m_partition_items
items for the PARTITION BY columns
Definition: window.h:245
int64 m_last_rowno_in_range_frame
Execution state: used for RANGE bounds frame evaluation for the continued evaluation for current row ...
Definition: window.h:619
int64 m_last_row_output
Execution state: The number, in the current partition, of the last output row, i.e.
Definition: window.h:488
void print_border(const THD *thd, String *str, PT_border *b, enum_query_type qt) const
Definition: window.cc:1424
Bounds_checked_array< Arg_comparator > m_comparators[2]
Definition: window.h:576
uint def_pos() const
Definition: window.h:779
Window(Item_string *name, PT_order_list *part, PT_order_list *ord, PT_frame *frame, bool is_reference, Item_string *inherit)
Generic window constructor, shared.
Definition: window.h:682
PT_frame *const m_frame
<window frame clause>
Definition: window.h:121
void print(const THD *thd, String *str, enum_query_type qt, bool expand_definition) const
Definition: window.cc:1468
int64 rowno_being_visited() const
See m_rowno_being_visited.
Definition: window.h:1217
bool optimizable_range_aggregates() const
Return true if the set of window functions are all RANGE unit optimizable.
Definition: window.h:1127
void check_partition_boundary()
Check if the just read input row marks the start of a new partition.
Definition: window.cc:457
void set_rowno_in_partition(int64 rowno)
See m_rowno_in_partition.
Definition: window.h:1344
void restore_pos(Window_retrieve_cached_row_reason reason)
See m_tmp_pos.
Definition: window.h:335
bool has_windowing_steps() const
Definition: window.cc:1518
void set_frame_buffer_total_rows(int64 rows)
See m_frame_buffer_total_rows.
Definition: window.h:1374
int64 frame_buffer_partition_offset() const
See m_frame_buffer_partition_offset.
Definition: window.h:1393
void set_is_last_row_in_frame(bool b)
See m_is_last_row_in_frame.
Definition: window.h:1315
void set_aggregates_primed(bool b)
See m_aggregates_primed.
Definition: window.h:1303
st_nth m_opt_nth_row
Window requires re-evaluation of the Nth row in optimized moving frame mode e.g.
Definition: window.h:238
int64 last_rowno_in_cache() const
See m_last_rowno_in_cache.
Definition: window.h:1227
bool needs_partition_cardinality() const
If we need to read the entire partition before we can evaluate some window function(s) on this window...
Definition: window.h:1113
ORDER * sorting_order(THD *thd=nullptr, bool implicit_grouping=false)
Concatenation of columns in PARTITION BY and ORDER BY.
Definition: window.cc:394
List< Item_sum > m_functions
window functions based on 'this'
Definition: window.h:243
void set_do_copy_null(bool b)
See m_do_copy_null.
Definition: window.h:1280
PT_order_list *const m_partition_by
<window partition clause>
Definition: window.h:118
static void reorder_and_eliminate_sorts(List< Window > *windows)
Reorder windows and eliminate redundant ordering.
Definition: window.cc:754
bool m_opt_last_row
Window requires re-evaluation of the last row in optimized moving frame mode e.g.
Definition: window.h:194
static bool setup_windows2(THD *thd, List< Window > *windows)
Like setup_windows1() but contains operations which must wait until the start of the execution phase.
Definition: window.cc:1310
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
const char * p
Definition: ctype-mb.cc:1235
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:31
Some integer typedefs for easier portability.
#define INT_MIN64
Definition: my_inttypes.h:75
unsigned char uchar
Definition: my_inttypes.h:52
int64_t int64
Definition: my_inttypes.h:68
uint64_t uint64
Definition: my_inttypes.h:69
thread_local MEM_ROOT ** THR_MALLOC
Definition: mysqld.cc:1557
static int record
Definition: mysqltest.cc:195
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Holds information about a position in the buffer frame as stored in a temporary file (cf.
Definition: window.h:267
int64 m_rowno
Definition: window.h:271
uchar * m_position
< The size of the file position is determined by handler::ref_length
Definition: window.h:269
Frame_buffer_position(uchar *position, int64 rowno)
Definition: window.h:272
Mem_root_array_YY< st_ll_offset > m_offsets
sorted set of LEAD/LAG offsets
Definition: window.h:230
st_ll_offset()
Definition: window.h:215
int64 m_rowno
negative values is LEAD
Definition: window.h:214
bool operator<(const st_ll_offset &a) const
Used for sorting offsets in ascending order for faster traversal of frame buffer tmp file.
Definition: window.h:220
Mem_root_array_YY< st_offset > m_offsets
sorted set of NTH_VALUE offsets
Definition: window.h:225
bool operator<(const st_offset &a) const
Used for sorting offsets in ascending order for faster traversal of frame buffer tmp file.
Definition: window.h:210
st_offset()
Definition: window.h:205
bool m_from_last
Definition: window.h:204
int64 m_rowno
Definition: window.h:203
Collects evaluation requirements from a window function, used by Item_sum::check_wf_semantics and its...
Definition: window.h:1556
bool needs_buffer
Set to true if window function requires row buffering.
Definition: window.h:1560
bool needs_last_peer_in_frame
Set to true if we need last peer for evaluation within a frame (e.g.
Definition: window.h:1569
bool opt_first_row
Set to true if we need FIRST_VALUE or optimized MIN/MAX.
Definition: window.h:1573
bool range_optimizable
Similar to row_optimizable but for RANGE frame bounds unit.
Definition: window.h:1591
Window_evaluation_requirements()
Definition: window.h:1593
Window::st_offset opt_nth_row
Used if we have NTH_VALUE.
Definition: window.h:1578
bool opt_last_row
Set to true if we need LAST_VALUE or optimized MIN/MAX.
Definition: window.h:1577
bool row_optimizable
Set to true if we can compute a sliding window by a combination of undoing the contribution of rows g...
Definition: window.h:1587
bool needs_peerset
Set to true if we need peerset for evaluation (e.g.
Definition: window.h:1564
Window::st_ll_offset opt_ll_row
Used if we have LEAD or LAG.
Definition: window.h:1579
constexpr int kMaxWindows
The number of windows is limited to avoid the stack blowing up when constructing iterators recursivel...
Definition: window.h:88
Window_retrieve_cached_row_reason
Position hints for the frame buffer are saved for these kind of row accesses, cf.
Definition: window.h:70
Mem_root_array< Func_ptr > Func_ptr_array
Definition: window.h:63