CUBRID Engine  latest
xasl.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * XASL - all structures required for XASL.
21  *
22  * NOTE: interface for client optimizer/executor and server.
23  */
24 
25 #ifndef _XASL_H_
26 #define _XASL_H_
27 
28 #include <assert.h>
29 
30 #include "access_json_table.hpp"
31 #include "access_spec.hpp"
32 #include "memory_hash.h"
33 #include "method_def.hpp"
34 #include "query_list.h"
35 #include "regu_var.hpp"
36 #include "storage_common.h"
37 #include "string_opfunc.h"
38 
39 #if defined (SERVER_MODE) || defined (SA_MODE)
40 #include "external_sort.h"
41 #include "heap_file.h"
42 #if defined (ENABLE_COMPOSITE_LOCK)
43 #include "lock_manager.h"
44 #endif /* defined (ENABLE_COMPOSITE_LOCK) */
46 #include "scan_manager.h"
47 #endif /* defined (SERVER_MODE) || defined (SA_MODE) */
48 
49 #if defined (SERVER_MODE) || defined (SA_MODE)
50 // forward definition
51 struct binary_heap;
52 #endif // SERVER_MODE || SA_MODE
53 
54 struct xasl_node;
55 typedef struct xasl_node XASL_NODE;
56 struct xasl_unpack_info;
58 
59 /* XASL HEADER */
60 /*
61  * XASL_NODE_HEADER has useful information that needs to be passed to client
62  * along with XASL_ID
63  *
64  * NOTE: Update XASL_NODE_HEADER_SIZE when this structure is changed
65  */
68 {
69  int xasl_flag; /* query flags (e.g, multi range optimization) */
70 };
71 
72 #define XASL_NODE_HEADER_SIZE OR_INT_SIZE /* xasl_flag */
73 
74 #define OR_PACK_XASL_NODE_HEADER(PTR, X) \
75  do \
76  { \
77  if ((PTR) == NULL) \
78  { \
79  break; \
80  } \
81  ASSERT_ALIGN ((PTR), INT_ALIGNMENT); \
82  (PTR) = or_pack_int ((PTR), (X)->xasl_flag); \
83  } \
84  while (0)
85 
86 #define OR_UNPACK_XASL_NODE_HEADER(PTR, X) \
87  do \
88  { \
89  if ((PTR) == NULL) \
90  { \
91  break; \
92  } \
93  ASSERT_ALIGN ((PTR), INT_ALIGNMENT); \
94  (PTR) = or_unpack_int ((PTR), &(X)->xasl_flag); \
95  } \
96  while (0)
97 
98 #define INIT_XASL_NODE_HEADER(X) \
99  do \
100  { \
101  if ((X) == NULL) \
102  { \
103  break; \
104  } \
105  memset ((X), 0x00, XASL_NODE_HEADER_SIZE); \
106  } \
107  while (0)
108 
109 /************************************************************************/
110 /* Enumerations */
111 /************************************************************************/
112 
113 #if defined (SERVER_MODE) || defined (SA_MODE)
114 typedef enum
115 {
116  XASL_CLEARED,
117  XASL_SUCCESS,
118  XASL_FAILURE,
119  XASL_INITIALIZED
120 } XASL_STATUS;
121 #endif /* defined (SERVER_MODE) || defined (SA_MODE) */
122 
123 /************************************************************************/
124 /* Ahead declarations */
125 /************************************************************************/
126 
127 /* ACCESS SPEC */
135 typedef union hybrid_node HYBRID_NODE;
136 
137 // *INDENT-OFF*
138 namespace cubxasl
139 {
140  struct aggregate_list_node;
141  struct analytic_eval_type;
142  struct pred_expr;
143 } // namespace cubxasl
147 // *INDENT-ON*
148 
149 #if defined (SERVER_MODE) || defined (SA_MODE)
150 typedef struct groupby_stat GROUPBY_STATS;
151 typedef struct orderby_stat ORDERBY_STATS;
152 typedef struct xasl_stat XASL_STATS;
153 
154 typedef struct topn_tuple TOPN_TUPLE;
155 typedef struct topn_tuples TOPN_TUPLES;
156 
157 // *INDENT-OFF*
158 namespace cubquery
159 {
160  struct aggregate_hash_context;
161 }
163 // *INDENT-ON*
164 
165 typedef struct partition_spec_node PARTITION_SPEC_TYPE;
166 #endif /* defined (SERVER_MODE) || defined (SA_MODE) */
167 
168 /************************************************************************/
169 /* XASL TREE */
170 /************************************************************************/
171 
172 typedef enum
173 {
190 } PROC_TYPE;
191 
192 typedef struct qproc_db_value_list *QPROC_DB_VALUE_LIST; /* TODO */
194 {
195  QPROC_DB_VALUE_LIST next;
198 
199  // *INDENT-OFF*
200  qproc_db_value_list () = default;
201  // *INDENT-ON*
202 };
203 
204 typedef struct val_list_node VAL_LIST; /* value list */
206 {
207  QPROC_DB_VALUE_LIST valp; /* first value node */
208  int val_cnt; /* value count */
209 
210  // *INDENT-OFF*
211  val_list_node () = default;
212  // *INDENT-ON*
213 };
214 
215 /* To handle selected update list, click counter related */
216 typedef struct selupd_list SELUPD_LIST;
218 {
219  SELUPD_LIST *next; /* Next node */
220  OID class_oid; /* OID of class to update after select */
221  HFID class_hfid; /* Heap file ID of the class */
222  int select_list_size; /* Size of select_list */
223  REGU_VARLIST_LIST select_list; /* Regu list to be selected */
224  int wait_msecs; /* lock timeout in milliseconds */
225 };
226 
227 /*update/delete class info structure */
230 {
231  int num_subclasses; /* total number of subclasses */
232  OID *class_oid; /* OID's of the classes */
233  HFID *class_hfid; /* Heap file ID's of the classes */
234  int num_attrs; /* total number of attrs involved */
235  int *att_id; /* ID's of attributes (array) */
236  int needs_pruning; /* perform partition pruning */
237  int has_uniques; /* whether there are unique constraints */
238 
239  int *num_lob_attrs; /* number of lob attributes for each subclass */
240  int **lob_attr_ids; /* list of log attribute ids for each subclass */
241 
242  int num_extra_assign_reev; /* no of integers in mvcc_extra_assign_reev */
243  int *mvcc_extra_assign_reev; /* indexes of classes in the select list that are referenced in assignments to the
244  * attributes of current class and are not referenced in conditions */
245 };
246 
247 /* assignment details structure for server update execution */
250 {
251  int cls_idx; /* index of the class that contains attribute to be updated */
252  int att_idx; /* index in the class attributes array */
253  DB_VALUE *constant; /* constant to be assigned to an attribute or NULL */
254  REGU_VARIABLE *regu_var; /* regu variable for rhs in assignment */
255  bool clear_value_at_clone_decache; /* true, if need to clear constant db_value at clone decache */
256 };
257 
258 /*on duplicate key update info structure */
259 typedef struct odku_info ODKU_INFO;
260 struct odku_info
261 {
262  PRED_EXPR *cons_pred; /* constraint predicate */
263  int num_assigns; /* number of assignments */
264  UPDATE_ASSIGNMENT *assignments; /* assignments */
265  HEAP_CACHE_ATTRINFO *attr_info; /* attr info */
266  int *attr_ids; /* ID's of attributes (array) */
267 
268  // *INDENT-OFF*
269  odku_info () = default;
270  // *INDENT-ON*
271 };
272 
273 /* new type used by function index for cleaner code */
274 typedef struct func_pred FUNC_PRED;
275 struct func_pred
276 {
277  REGU_VARIABLE *func_regu; /* function expression regulator variable */
279 
280  // *INDENT-OFF*
281  func_pred () = default;
282  // *INDENT-ON*
283 };
284 
285 /* UNION_PROC, DIFFERENCE_PROC, INTERSECTION_PROC */
288 {
289  XASL_NODE *left; /* first subquery */
290  XASL_NODE *right; /* second subquery */
291 };
292 
293 /* OBJFETCH_PROC */
296 {
297  DB_VALUE *arg; /* argument: oid or oid_set */
298  PRED_EXPR *set_pred; /* predicate expression */
299  bool fetch_res; /* path expr. fetch result */
300  bool ql_flag; /* on/off flag */
301 };
302 
305 {
306  DB_VALUE **output_columns; /* array of pointers to the value list that hold the values of temporary list file
307  * columns -- used only in XASL generator */
308  XASL_NODE *eptr_list; /* having subquery list */
309  SORT_LIST *groupby_list; /* sorting fields */
310  SORT_LIST *after_groupby_list; /* sorting fields */
311  QFILE_LIST_ID *push_list_id; /* file descriptor for push list */
312  OUTPTR_LIST *g_outptr_list; /* group_by output ptr list */
313  REGU_VARIABLE_LIST g_regu_list; /* group_by regu. list */
314  VAL_LIST *g_val_list; /* group_by value list */
315  PRED_EXPR *g_having_pred; /* having predicate */
316  PRED_EXPR *g_grbynum_pred; /* groupby_num() predicate */
317  DB_VALUE *g_grbynum_val; /* groupby_num() value result */
318  AGGREGATE_TYPE *g_agg_list; /* aggregate function list */
319  REGU_VARIABLE_LIST g_hk_scan_regu_list; /* group_by key regu list during scan */
320  REGU_VARIABLE_LIST g_hk_sort_regu_list; /* group_by key regu list during sort */
321  REGU_VARIABLE_LIST g_scan_regu_list; /* group_by regulist during scan */
322  ANALYTIC_EVAL_TYPE *a_eval_list; /* analytic functions evaluation groups */
323  REGU_VARIABLE_LIST a_regu_list; /* analytic regu list */
324  OUTPTR_LIST *a_outptr_list; /* analytic output ptr list */
325  OUTPTR_LIST *a_outptr_list_ex; /* ext output ptr list */
326  OUTPTR_LIST *a_outptr_list_interm; /* intermediate output list */
327  VAL_LIST *a_val_list; /* analytic value list */
328  int g_grbynum_flag; /* stop or continue grouping? */
329  bool g_with_rollup; /* WITH ROLLUP clause for GROUP BY */
330  int g_hash_eligible; /* eligible for hash aggregate evaluation */
331  int g_output_first_tuple; /* output first tuple of each group */
332  int g_hkey_size; /* group by key size */
333  int g_func_count; /* aggregate function count */
334 #if defined (SERVER_MODE) || defined (SA_MODE)
335  EHID *upddel_oid_locator_ehids; /* array of temporary extensible hash for UPDATE/DELETE generated SELECT
336  * statement */
337  AGGREGATE_HASH_CONTEXT *agg_hash_context; /* hash aggregate context, not serialized */
338 #endif /* defined (SERVER_MODE) || defined (SA_MODE) */
339  int g_agg_domains_resolved; /* domain status (not serialized) */
340 };
341 
344 {
345  PRED_EXPR *having_pred; /* having predicate */
346  DB_VALUE *grbynum_val; /* groupby_num() value result */
347  AGGREGATE_TYPE *agg_list; /* aggregate function list */
348  ARITH_TYPE *outarith_list; /* outside arithmetic list */
349  int is_always_false; /* always-false agg-query? */
350  int agg_domains_resolved; /* domain status (not serialized) */
351 };
352 
355 {
356  XASL_NODE *outer_xasl; /* xasl node containing the outer list file */
357  ACCESS_SPEC_TYPE *outer_spec_list; /* access spec. list for outer */
358  VAL_LIST *outer_val_list; /* output-value list for outer */
359  XASL_NODE *inner_xasl; /* xasl node containing the inner list file */
360  ACCESS_SPEC_TYPE *inner_spec_list; /* access spec. list for inner */
361  VAL_LIST *inner_val_list; /* output-value list for inner */
362 
363  QFILE_LIST_MERGE_INFO ls_merge; /* list file merge info */
364 };
365 
368 {
369  int num_classes; /* total number of classes involved */
370  UPDDEL_CLASS_INFO *classes; /* details for each class in the update list */
371  PRED_EXPR *cons_pred; /* constraint predicate */
372  int num_assigns; /* total no. of assignments */
373  UPDATE_ASSIGNMENT *assigns; /* assignments array */
374  int wait_msecs; /* lock timeout in milliseconds */
375  int no_logging; /* no logging */
376  int num_orderby_keys; /* no of keys for ORDER_BY */
378  int num_reev_classes; /* no of classes involved in mvcc condition and assignment reevaluation */
379  int *mvcc_reev_classes; /* array of indexes into the SELECT list that references pairs of OID - CLASS OID used
380  * in conditions and assignment reevaluation */
381 };
382 
385 {
386  OID class_oid; /* OID of the class involved */
387  HFID class_hfid; /* Heap file ID of the class */
388  int num_vals; /* total number of attrs involved */
389  int num_default_expr; /* total number of attrs which require a default value to be inserted */
390  int *att_id; /* ID's of attributes (array) */
391  DB_VALUE **vals; /* values (array) */
392  PRED_EXPR *cons_pred; /* constraint predicate */
393  ODKU_INFO *odku; /* ON DUPLICATE KEY UPDATE assignments */
394  int has_uniques; /* whether there are unique constraints */
395  int wait_msecs; /* lock timeout in milliseconds */
396  int no_logging; /* no logging */
397  int do_replace; /* duplicate tuples should be replaced */
398  int pruning_type; /* DB_CLASS_PARTITION_TYPE indicating the way in which pruning should be performed */
399  int num_val_lists; /* number of value lists in values clause */
400  VALPTR_LIST **valptr_lists; /* OUTPTR lists for each list of values */
401  DB_VALUE *obj_oid; /* Inserted object OID, used for sub-inserts */
402 };
403 
406 {
407  UPDDEL_CLASS_INFO *classes; /* classes info */
408  int num_classes; /* total number of classes involved */
409  int wait_msecs; /* lock timeout in milliseconds */
410  int no_logging; /* no logging */
411  int num_reev_classes; /* no of classes involved in mvcc condition */
412  int *mvcc_reev_classes; /* array of indexes into the SELECT list that references pairs of OID - CLASS OID used
413  * in conditions */
414 };
415 
418 {
419  PRED_EXPR *start_with_pred; /* START WITH predicate */
420  PRED_EXPR *after_connect_by_pred; /* after CONNECT BY predicate */
421  QFILE_LIST_ID *input_list_id; /* CONNECT BY input list file */
422  QFILE_LIST_ID *start_with_list_id; /* START WITH list file */
423  REGU_VARIABLE_LIST regu_list_pred; /* positional regu list for fetching val list */
424  REGU_VARIABLE_LIST regu_list_rest; /* rest of regu vars */
425  VAL_LIST *prior_val_list; /* val list for use with parent tuple */
426  OUTPTR_LIST *prior_outptr_list; /* out list for use with parent tuple */
427  REGU_VARIABLE_LIST prior_regu_list_pred; /* positional regu list for parent tuple */
428  REGU_VARIABLE_LIST prior_regu_list_rest; /* rest of regu vars */
429  REGU_VARIABLE_LIST after_cb_regu_list_pred; /* regu list for after_cb pred */
431  bool single_table_opt; /* single table optimizations */
432  QFILE_TUPLE curr_tuple; /* needed for operators and functions */
433 };
434 
437 {
438  XASL_NODE *update_xasl; /* XASL for UPDATE part */
439  XASL_NODE *insert_xasl; /* XASL for INSERT part */
440  bool has_delete; /* MERGE statement has DELETE */
441 };
442 
445 {
446  XASL_NODE *non_recursive_part; /* non recursive part of the CTE */
447  XASL_NODE *recursive_part; /* recursive part of the CTE */
448 };
449 
450 /*
451  * Macros for xasl structure
452  */
453 
454 #define XASL_WAIT_MSECS_NOCHANGE -2
455 
456 #define XASL_ORDBYNUM_FLAG_SCAN_CONTINUE 0x01
457 #define XASL_ORDBYNUM_FLAG_SCAN_CHECK 0x02
458 #define XASL_ORDBYNUM_FLAG_SCAN_STOP 0x04
459 
460 #define XASL_INSTNUM_FLAG_SCAN_CONTINUE 0x01
461 #define XASL_INSTNUM_FLAG_SCAN_CHECK 0x02
462 #define XASL_INSTNUM_FLAG_SCAN_STOP 0x04
463 #define XASL_INSTNUM_FLAG_SCAN_LAST_STOP 0x08
464 #define XASL_INSTNUM_FLAG_EVAL_DEFER 0x10
465 #define XASL_INSTNUM_FLAG_SCAN_STOP_AT_ANALYTIC 0x20
466 
467 /*
468  * Macros for buildlist block
469  */
470 
471 #define XASL_G_GRBYNUM_FLAG_SCAN_CONTINUE 0x01
472 #define XASL_G_GRBYNUM_FLAG_SCAN_CHECK 0x02
473 #define XASL_G_GRBYNUM_FLAG_SCAN_STOP 0x04
474 #define XASL_G_GRBYNUM_FLAG_LIMIT_LT 0x08
475 #define XASL_G_GRBYNUM_FLAG_LIMIT_GT_LT 0x10
476 
477 #define XASL_LINK_TO_REGU_VARIABLE 0x01 /* is linked to regu variable ? */
478 #define XASL_SKIP_ORDERBY_LIST 0x02 /* skip sorting for orderby_list ? */
479 #define XASL_ZERO_CORR_LEVEL 0x04 /* is zero-level uncorrelated subquery ? */
480 #define XASL_TOP_MOST_XASL 0x08 /* this is a top most XASL */
481 #define XASL_TO_BE_CACHED 0x10 /* the result will be cached */
482 #define XASL_HAS_NOCYCLE 0x20 /* NOCYCLE is specified */
483 #define XASL_HAS_CONNECT_BY 0x40 /* has CONNECT BY clause */
484 #define XASL_MULTI_UPDATE_AGG 0x80 /* is for multi-update with aggregate */
485 #define XASL_IGNORE_CYCLES 0x100 /* is for LEVEL usage in connect by clause... sometimes cycles may be ignored */
486 #define XASL_OBJFETCH_IGNORE_CLASSOID 0x200 /* fetch proc should ignore class oid */
487 #define XASL_IS_MERGE_QUERY 0x400 /* query belongs to a merge statement */
488 #define XASL_USES_MRO 0x800 /* query uses multi range optimization */
489 #define XASL_DECACHE_CLONE 0x1000 /* decache clone */
490 #define XASL_RETURN_GENERATED_KEYS 0x2000 /* return generated keys */
491 #define XASL_NO_FIXED_SCAN 0x4000 /* disable fixed scan for this proc */
492 #define XASL_NEED_SINGLE_TUPLE_SCAN 0x8000 /* for exists operation */
493 #define XASL_INCLUDES_TDE_CLASS 0x10000 /* is any tde class related */
494 
495 #define XASL_IS_FLAGED(x, f) (((x)->flag & (int) (f)) != 0)
496 #define XASL_SET_FLAG(x, f) (x)->flag |= (int) (f)
497 #define XASL_CLEAR_FLAG(x, f) (x)->flag &= (int) ~(f)
498 
499 #define EXECUTE_REGU_VARIABLE_XASL(thread_p, r, v) \
500  do \
501  { \
502  XASL_NODE *_x = (r)->xasl; \
503  \
504  /* check for xasl node */ \
505  if (_x) \
506  { \
507  if (XASL_IS_FLAGED (_x, XASL_LINK_TO_REGU_VARIABLE)) \
508  { \
509  /* clear correlated subquery list files */ \
510  if ((_x)->status == XASL_CLEARED || (_x)->status == XASL_INITIALIZED) \
511  { \
512  /* execute xasl query */ \
513  if (qexec_execute_mainblock ((thread_p), _x, (v)->xasl_state, NULL) != NO_ERROR) \
514  { \
515  (_x)->status = XASL_FAILURE; \
516  } \
517  } \
518  } \
519  else \
520  { \
521  /* currently, not-supported unknown case */ \
522  (_x)->status = XASL_FAILURE; /* return error */ \
523  } \
524  } \
525  } \
526  while (0)
527 
528 #define CHECK_REGU_VARIABLE_XASL_STATUS(r) \
529  ((r)->xasl != NULL ? ((r)->xasl)->status : XASL_SUCCESS)
530 
531 #define QPROC_IS_INTERPOLATION_FUNC(func_p) \
532  (((func_p)->function == PT_MEDIAN) \
533  || ((func_p)->function == PT_PERCENTILE_CONT) \
534  || ((func_p)->function == PT_PERCENTILE_DISC))
535 
536  /* pseudocolumns offsets in tuple (from end) */
537 #define PCOL_ISCYCLE_TUPLE_OFFSET 1
538 #define PCOL_ISLEAF_TUPLE_OFFSET 2
539 #define PCOL_LEVEL_TUPLE_OFFSET 3
540 #define PCOL_INDEX_STRING_TUPLE_OFFSET 4
541 #define PCOL_PARENTPOS_TUPLE_OFFSET 5
542 #define PCOL_FIRST_TUPLE_OFFSET PCOL_PARENTPOS_TUPLE_OFFSET
543 
544 /* XASL FILE IDENTIFICATION */
545 
546 #define XASL_ID_SET_NULL(X) \
547  do \
548  { \
549  (X)->sha1.h[0] = 0; \
550  (X)->sha1.h[1] = 0; \
551  (X)->sha1.h[2] = 0; \
552  (X)->sha1.h[3] = 0; \
553  (X)->sha1.h[4] = 0; \
554  (X)->cache_flag = 0; \
555  (X)->time_stored.sec = 0; \
556  (X)->time_stored.usec = 0; \
557  } \
558  while (0)
559 
560 #define XASL_ID_IS_NULL(X) (((XASL_ID *) (X) != NULL) && (X)->time_stored.sec == 0)
561 
562 #define XASL_ID_COPY(X1, X2) \
563  do \
564  { \
565  (X1)->sha1 = (X2)->sha1; \
566  (X1)->time_stored = (X2)->time_stored; \
567  /* Do not copy cache_flag. */ \
568  } \
569  while (0)
570 
571 /* do not compare with X.time_stored */
572 #define XASL_ID_EQ(X1, X2) \
573  ((X1) == (X2) \
574  || (SHA1Compare (&(X1)->sha1, &(X2)->sha1) == 0 \
575  && (X1)->time_stored.sec == (X2)->time_stored.sec \
576  && (X1)->time_stored.usec == (X2)->time_stored.usec))
577 
578 #define OR_XASL_ID_SIZE (OR_SHA1_SIZE + OR_CACHE_TIME_SIZE)
579 
580 /* pack XASL_ID */
581 #define OR_PACK_XASL_ID(PTR, X) \
582  do \
583  { \
584  assert ((X) != NULL); \
585  PTR = or_pack_sha1 (PTR, &(X)->sha1); \
586  OR_PACK_CACHE_TIME (PTR, &(X)->time_stored); \
587  } \
588  while (0)
589 
590 /* unpack XASL_ID */
591 #define OR_UNPACK_XASL_ID(PTR, X) \
592  do \
593  { \
594  assert ((X) != NULL); \
595  PTR = or_unpack_sha1 (PTR, &(X)->sha1); \
596  OR_UNPACK_CACHE_TIME (PTR, &((X)->time_stored)); \
597  } \
598  while (0)
599 
600 /************************************************************************/
601 /* XASL stream */
602 /************************************************************************/
603 
604 /* this must be non-0 and probably should be word aligned */
605 #define XASL_STREAM_HEADER 8
606 
607 typedef struct xasl_stream XASL_STREAM;
609 {
612 
613  char *buffer;
615 };
616 
617 #define XASL_STREAM_HEADER_PTR(stream) \
618  ((char *) (stream))
619 #define GET_XASL_STREAM_HEADER_SIZE(stream) \
620  (*((int *) XASL_STREAM_HEADER_PTR(stream)))
621 #define SET_XASL_STREAM_HEADER_SIZE(stream, size) \
622  (*((int *) XASL_STREAM_HEADER_PTR(stream)) = (size))
623 #define GET_XASL_STREAM_HEADER_DATA(stream) \
624  ((char *) XASL_STREAM_HEADER_PTR(stream) + sizeof(int))
625 #define SET_XASL_STREAM_HEADER_DATA(stream, data, size) \
626  SET_XASL_STREAM_HEADER_SIZE(stream, size); \
627  (void) memcpy((void *) GET_XASL_STREAM_HEADER_DATA(stream), \
628  (void *) (data), (size_t) (size))
629 
630 #define XASL_STREAM_BODY_PTR(stream) \
631  (GET_XASL_STREAM_HEADER_DATA(stream) + GET_XASL_STREAM_HEADER_SIZE(stream))
632 #define GET_XASL_STREAM_BODY_SIZE(stream) \
633  (*((int *) XASL_STREAM_BODY_PTR(stream)))
634 #define SET_XASL_STREAM_BODY_SIZE(stream, size) \
635  (*((int *) XASL_STREAM_BODY_PTR(stream)) = (size))
636 #define GET_XASL_STREAM_BODY_DATA(stream) \
637  ((char *) XASL_STREAM_BODY_PTR(stream) + sizeof(int))
638 #define SET_XASL_STREAM_BODY_DATA(stream, data, size) \
639  (void) memcpy((void *) GET_XASL_STREAM_BODY_DATA(stream), \
640  (void *) (data), (size_t) (size))
641 
642 #define GET_XASL_HEADER_CREATOR_OID(header) \
643  ((OID *) header)
644 #define SET_XASL_HEADER_CREATOR_OID(header, oid) \
645  (*((OID *) header) = *(oid))
646 #define GET_XASL_HEADER_N_OID_LIST(header) \
647  (*((int *) ((char *) (header) + sizeof(OID))))
648 #define SET_XASL_HEADER_N_OID_LIST(header, n) \
649  (*((int *) ((char *) (header) + sizeof(OID))) = (n))
650 #define GET_XASL_HEADER_CLASS_OID_LIST(header) \
651  ((OID *) ((char *) (header) + sizeof(OID) + sizeof(int)))
652 #define SET_XASL_HEADER_CLASS_OID_LIST(header, list, n) \
653  (void) memcpy((void *) GET_XASL_HEADER_CLASS_OID_LIST(header), \
654  (void *) (list), (size_t) sizeof(OID) * (n))
655 #define GET_XASL_HEADER_REPR_ID_LIST(header) \
656  ((int *) ((char *) (header) + sizeof(OID) + sizeof(int) + \
657  GET_XASL_HEADER_N_OID_LIST(header) * sizeof(OID)))
658 #define SET_XASL_HEADER_REPR_ID_LIST(header, list, n) \
659  (void) memcpy((void *) GET_XASL_HEADER_REPR_ID_LIST(header), \
660  (void *) (list), (size_t) sizeof(int) * (n))
661 #define GET_XASL_HEADER_DBVAL_CNT(header) \
662  (*((int *) ((char *) (header) + sizeof(OID) + sizeof(int) + \
663  GET_XASL_HEADER_N_OID_LIST(header) * sizeof(OID) + \
664  GET_XASL_HEADER_N_OID_LIST(header) * sizeof(int))))
665 #define SET_XASL_HEADER_DBVAL_CNT(header, cnt) \
666  (*((int *) ((char *) (header) + sizeof(OID) + sizeof(int) + \
667  GET_XASL_HEADER_N_OID_LIST(header) * sizeof(OID) + \
668  GET_XASL_HEADER_N_OID_LIST(header) * sizeof(int))) = (cnt))
669 
670 
671 /************************************************************************/
672 /* access spec */
673 /************************************************************************/
674 
675 typedef enum
676 {
685 } TARGET_TYPE;
686 
687 typedef enum
688 {
689  ACCESS_METHOD_SEQUENTIAL, /* sequential scan access */
690  ACCESS_METHOD_INDEX, /* indexed access */
691  ACCESS_METHOD_JSON_TABLE, /* json table scan access */
692  ACCESS_METHOD_SCHEMA, /* schema access */
693  ACCESS_METHOD_SEQUENTIAL_RECORD_INFO, /* sequential scan that will read record info */
694  ACCESS_METHOD_SEQUENTIAL_PAGE_SCAN, /* sequential scan access that only scans pages without accessing record data */
695  ACCESS_METHOD_INDEX_KEY_INFO, /* indexed access to obtain key information */
696  ACCESS_METHOD_INDEX_NODE_INFO /* indexed access to obtain b-tree node info */
697 } ACCESS_METHOD;
698 
699 #define IS_ANY_INDEX_ACCESS(access_) \
700  ((access_) == ACCESS_METHOD_INDEX || (access_) == ACCESS_METHOD_INDEX_KEY_INFO \
701  || (access_) == ACCESS_METHOD_INDEX_NODE_INFO)
702 
703 typedef enum
704 {
710 
711 typedef enum
712 {
714  ACCESS_SPEC_FLAG_FOR_UPDATE = 0x01 /* used with FOR UPDATE clause. The spec that will be locked. */
716 
718 {
719  REGU_VARIABLE_LIST cls_regu_list_key; /* regu list for the key filter */
720  REGU_VARIABLE_LIST cls_regu_list_pred; /* regu list for the predicate */
721  REGU_VARIABLE_LIST cls_regu_list_rest; /* regu list for rest of attrs */
722  REGU_VARIABLE_LIST cls_regu_list_range; /* regu list for range part of a condition. Used only in reevaluation
723  * at index scan */
724  OUTPTR_LIST *cls_output_val_list; /* regu list writer for val list */
725  REGU_VARIABLE_LIST cls_regu_val_list; /* regu list reader for val list */
726  HFID hfid; /* heap file identifier */
727  OID cls_oid; /* class object identifier */
728  ATTR_ID *attrids_key; /* array of attr ids from the key filter */
729  HEAP_CACHE_ATTRINFO *cache_key; /* cache for the key filter attrs */
730  int num_attrs_key; /* number of atts from the key filter */
731  int num_attrs_pred; /* number of atts from the predicate */
732  ATTR_ID *attrids_pred; /* array of attr ids from the pred */
733  HEAP_CACHE_ATTRINFO *cache_pred; /* cache for the pred attrs */
734  ATTR_ID *attrids_rest; /* array of attr ids other than pred */
735  HEAP_CACHE_ATTRINFO *cache_rest; /* cache for the non-pred attrs */
736  int num_attrs_rest; /* number of atts other than pred */
737  ACCESS_SCHEMA_TYPE schema_type; /* schema type */
738  DB_VALUE **cache_reserved; /* cache for record information */
740  REGU_VARIABLE_LIST cls_regu_list_reserved; /* regu list for record info */
741  ATTR_ID *attrids_range; /* array of attr ids from the range filter. Used only in reevaluation at index scan */
742  HEAP_CACHE_ATTRINFO *cache_range; /* cache for the range attributes. Used only in reevaluation at index scan */
743  int num_attrs_range; /* number of atts for the range filter. Used only in reevaluation at index scan */
744 };
745 
747 {
748  REGU_VARIABLE_LIST list_regu_list_pred; /* regu list for the predicate */
749  REGU_VARIABLE_LIST list_regu_list_rest; /* regu list for rest of attrs */
750  REGU_VARIABLE_LIST list_regu_list_build; /* regu list for hash build */
751  REGU_VARIABLE_LIST list_regu_list_probe; /* regu list for hash probe */
752  int hash_list_scan_yn; /* Is hash list scan possible? */
753  XASL_NODE *xasl_node; /* the XASL node that contains the list file identifier */
754 };
755 
757 {
758  SHOWSTMT_TYPE show_type; /* show statement type */
759  REGU_VARIABLE_LIST arg_list; /* show statement args */
760 };
761 
763 {
764  REGU_VARIABLE_LIST set_regu_list; /* regulator variable list */
765  REGU_VARIABLE *set_ptr; /* set regu variable */
766 };
767 
769 {
770  REGU_VARIABLE_LIST method_regu_list; /* regulator variable list */
771  XASL_NODE *xasl_node; /* the XASL node that contains the */
772  /* list file ID for the method */
773  /* arguments */
774  METHOD_SIG_LIST *method_sig_list; /* method signature list */
775 };
776 
778 {
779  VALPTR_LIST *valptr_list; /* point to xasl.outptr_list */
780 };
781 
783 {
784  CLS_SPEC_TYPE cls_node; /* class specification */
785  LIST_SPEC_TYPE list_node; /* list specification */
786  SHOWSTMT_SPEC_TYPE showstmt_node; /* show stmt specification */
787  SET_SPEC_TYPE set_node; /* set specification */
788  METHOD_SPEC_TYPE method_node; /* method specification */
789  REGUVAL_LIST_SPEC_TYPE reguval_list_node; /* reguval_list specification */
790  json_table_spec_node json_table_node; /* json_table specification */
791 }; /* class/list access specification */
792 
793 /*
794  * Macros for easier handling of the ACCESS_SPEC_TYPE members.
795  */
796 
797 #define ACCESS_SPEC_CLS_SPEC(ptr) \
798  ((ptr)->s.cls_node)
799 
800 #define ACCESS_SPEC_CLS_REGU_LIST(ptr) \
801  ((ptr)->s.cls_node.cls_regu_list)
802 
803 #define ACCESS_SPEC_HFID(ptr) \
804  ((ptr)->s.cls_node.hfid)
805 
806 #define ACCESS_SPEC_CLS_OID(ptr) \
807  ((ptr)->s.cls_node.cls_oid)
808 
809 #define ACCESS_SPEC_LIST_SPEC(ptr) \
810  ((ptr)->s.list_node)
811 
812 #define ACCESS_SPEC_SHOWSTMT_SPEC(ptr) \
813  ((ptr)->s.showstmt_node)
814 
815 #define ACCESS_SPEC_RLIST_SPEC(ptr) \
816  ((ptr)->s.reguval_list_node)
817 
818 #define ACCESS_SPEC_LIST_REGU_LIST(ptr) \
819  ((ptr)->s.list_node.list_regu_list)
820 
821 #define ACCESS_SPEC_XASL_NODE(ptr) \
822  ((ptr)->s.list_node.xasl_node)
823 
824 #define ACCESS_SPEC_LIST_ID(ptr) \
825  (ACCESS_SPEC_XASL_NODE(ptr)->list_id)
826 
827 #define ACCESS_SPEC_CONNECT_BY_LIST_ID(ptr) \
828  (ACCESS_SPEC_XASL_NODE(ptr)->proc.connect_by.input_list_id)
829 
830 #define ACCESS_SPEC_RLIST_VALPTR_LIST(ptr) \
831  ((ptr)->s.reguval_list_node.valptr_list)
832 
833 #define ACCESS_SPEC_SET_SPEC(ptr) \
834  ((ptr)->s.set_node)
835 
836 #define ACCESS_SPEC_SET_PTR(ptr) \
837  ((ptr)->s.set_node.set_ptr)
838 
839 #define ACCESS_SPEC_SET_REGU_LIST(ptr) \
840  ((ptr)->s.set_node.set_regu_list)
841 
842 #define ACCESS_SPEC_METHOD_SPEC(ptr) \
843  ((ptr)->s.method_node)
844 
845 #define ACCESS_SPEC_JSON_TABLE_SPEC(ptr) \
846  ((ptr)->s.json_table_node)
847 
848 #define ACCESS_SPEC_METHOD_XASL_NODE(ptr) \
849  ((ptr)->s.method_node.xasl_node)
850 
851 #define ACCESS_SPEC_METHOD_REGU_LIST(ptr) \
852  ((ptr)->s.method_node.method_regu_list)
853 
854 #define ACCESS_SPEC_METHOD_SIG_LIST(ptr) \
855  ((ptr)->s.method_node.method_sig_list)
856 
857 #define ACCESS_SPEC_METHOD_LIST_ID(ptr) \
858  (ACCESS_SPEC_METHOD_XASL_NODE(ptr)->list_id)
859 
860 #define ACCESS_SPEC_JSON_TABLE_ROOT_NODE(ptr) \
861  ((ptr)->s.json_table_node.m_root_node)
862 
863 #define ACCESS_SPEC_JSON_TABLE_REGU_VAR(ptr) \
864  ((ptr)->s.json_table_node.m_json_reguvar)
865 
866 #define ACCESS_SPEC_JSON_TABLE_M_NODE_COUNT(ptr) \
867  ((ptr)->s.json_table_node.m_node_count)
868 
869 #if defined (SERVER_MODE) || defined (SA_MODE)
870 struct orderby_stat
871 {
872  struct timeval orderby_time;
873  bool orderby_filesort;
874  bool orderby_topnsort;
875  UINT64 orderby_pages;
876  UINT64 orderby_ioreads;
877 };
878 
879 struct groupby_stat
880 {
881  struct timeval groupby_time;
882  UINT64 groupby_pages;
883  UINT64 groupby_ioreads;
884  int rows;
885  AGGREGATE_HASH_STATE groupby_hash;
886  bool run_groupby;
887  bool groupby_sort;
888 };
889 
890 struct xasl_stat
891 {
892  struct timeval elapsed_time;
893  UINT64 fetches;
894  UINT64 ioreads;
895 };
896 
897 /* top-n sorting object */
898 struct topn_tuples
899 {
900  SORT_LIST *sort_items; /* sort items position in tuple and sort order */
901  struct binary_heap *heap; /* heap used to hold top-n tuples */
902  TOPN_TUPLE *tuples; /* actual tuples stored in memory */
903  int values_count; /* number of values in a tuple */
904  UINT64 total_size; /* size in bytes of stored tuples */
905  UINT64 max_size; /* maximum size which tuples may occupy */
906 };
907 
908 struct topn_tuple
909 {
910  DB_VALUE *values; /* tuple values */
911  int values_size; /* total size in bytes occupied by the objects stored in the values array */
912 };
913 
914 struct partition_spec_node
915 {
916  OID oid; /* class oid */
917  HFID hfid; /* class hfid */
918  BTID btid; /* index id */
919  PARTITION_SPEC_TYPE *next; /* next partition */
920 };
921 #endif /* defined (SERVER_MODE) || defined (SA_MODE) */
922 
924 {
925  TARGET_TYPE type; /* target class or list */
926  ACCESS_METHOD access; /* access method */
927  INDX_INFO *indexptr; /* index info if index accessing */
929  PRED_EXPR *where_key; /* key filter expression */
930  PRED_EXPR *where_pred; /* predicate expression */
931  PRED_EXPR *where_range; /* used in mvcc UPDATE/DELETE reevaluation */
932  HYBRID_NODE s; /* class/list access specification */
933  QPROC_SINGLE_FETCH single_fetch; /* open scan in single fetch mode */
934  DB_VALUE *s_dbval; /* single fetch mode db_value */
935  ACCESS_SPEC_TYPE *next; /* next access specification */
936  int pruning_type; /* how pruning should be performed on this access spec performed */
937  ACCESS_SPEC_FLAG flags; /* flags from ACCESS_SPEC_FLAG enum */
938 #if defined (SERVER_MODE) || defined (SA_MODE)
939  SCAN_ID s_id; /* scan identifier */
940  PARTITION_SPEC_TYPE *parts; /* partitions of the current spec */
941  PARTITION_SPEC_TYPE *curent; /* current partition */
942  bool grouped_scan; /* grouped or regular scan? it is never true!!! */
943  bool fixed_scan; /* scan pages are kept fixed? */
944  bool pruned; /* true if partition pruning has been performed */
945  bool clear_value_at_clone_decache; /* true, if need to clear s_dbval at clone decache */
946 #endif /* #if defined (SERVER_MODE) || defined (SA_MODE) */
947 };
948 
949 struct xasl_node
950 {
951  XASL_NODE_HEADER header; /* XASL header */
952  XASL_NODE *next; /* next XASL block */
953  PROC_TYPE type; /* XASL type */
954  int flag; /* flags */
955  QFILE_LIST_ID *list_id; /* list file identifier */
956  SORT_LIST *after_iscan_list; /* sorting fields */
957  SORT_LIST *orderby_list; /* sorting fields */
958  PRED_EXPR *ordbynum_pred; /* orderby_num() predicate */
959  DB_VALUE *ordbynum_val; /* orderby_num() value result */
960  REGU_VARIABLE *orderby_limit; /* the limit to use in top K sorting. Computed from [ordby_num < X] clauses */
961  int ordbynum_flag; /* stop or continue ordering? */
962 
963  VAL_LIST *single_tuple; /* single tuple result */
964 
965  int is_single_tuple; /* single tuple subquery? */
966 
967  QUERY_OPTIONS option; /* UNIQUE option */
968  OUTPTR_LIST *outptr_list; /* output pointer list */
969  SELUPD_LIST *selected_upd_list; /* click counter related */
970  ACCESS_SPEC_TYPE *spec_list; /* access spec. list */
971  ACCESS_SPEC_TYPE *merge_spec; /* merge spec. node */
972  VAL_LIST *val_list; /* output-value list */
973  VAL_LIST *merge_val_list; /* value list for the merge spec */
974  XASL_NODE *aptr_list; /* CTEs and uncorrelated subquery. CTEs are guaranteed always before the subqueries */
975  XASL_NODE *bptr_list; /* OBJFETCH_PROC list */
976  XASL_NODE *dptr_list; /* corr. subquery list */
977  PRED_EXPR *after_join_pred; /* after-join predicate */
978  PRED_EXPR *if_pred; /* if predicate */
979  PRED_EXPR *instnum_pred; /* inst_num() predicate */
980  DB_VALUE *instnum_val; /* inst_num() value result */
981  DB_VALUE *save_instnum_val; /* inst_num() value kept after being substi- tuted for ordbynum_val; */
982  REGU_VARIABLE *limit_offset; /* offset of limit clause */
983  REGU_VARIABLE *limit_row_count; /* the record count from limit clause */
984  XASL_NODE *fptr_list; /* after OBJFETCH_PROC list */
985  XASL_NODE *scan_ptr; /* SCAN_PROC pointer */
986 
987  XASL_NODE *connect_by_ptr; /* CONNECT BY xasl pointer */
988  DB_VALUE *level_val; /* LEVEL value result */
989  REGU_VARIABLE *level_regu; /* regu variable used for fetching level_val from tuple; not to be confused with the
990  * LEVEL expr regu var from select list or where preds! */
991  DB_VALUE *isleaf_val; /* CONNECT_BY_ISLEAF value result */
992  REGU_VARIABLE *isleaf_regu; /* CONNECT_BY_ISLEAF regu variable */
993  DB_VALUE *iscycle_val; /* CONNECT_BY_ISCYCLE value result */
994  REGU_VARIABLE *iscycle_regu; /* CONNECT_BY_ISCYCLE regu variable */
995 
996  ACCESS_SPEC_TYPE *curr_spec; /* current spec. node */
997  int instnum_flag; /* stop or continue scan? */
998  int next_scan_on; /* next scan is initiated ? */
999  int next_scan_block_on; /* next scan block is initiated ? */
1000 
1001  int cat_fetched; /* catalog information fetched? */
1002  int query_in_progress; /* flag which tells if the query is currently executing. Used by
1003  * qmgr_clear_trans_wakeup() to determine how much of the xasl tree to clean up. */
1004 
1006  int upd_del_class_cnt; /* number of classes affected by update or delete (used only in case of UPDATE or
1007  * DELETE in the generated SELECT statement) */
1008  int mvcc_reev_extra_cls_cnt; /* number of extra OID - CLASS_OID pairs added to the select list in case of
1009  * UPDATE/DELETE in MVCC */
1010 #if defined (ENABLE_COMPOSITE_LOCK)
1011  /* note: upon reactivation, you may face header cross reference issues */
1012  LK_COMPOSITE_LOCK composite_lock; /* flag and lock block for composite locking for queries which obtain candidate
1013  * rows for updates/deletes. */
1014 #endif /* defined (ENABLE_COMPOSITE_LOCK) */
1015  union
1016  {
1017  UNION_PROC_NODE union_; /* UNION_PROC, DIFFERENCE_PROC, INTERSECTION_PROC */
1018  FETCH_PROC_NODE fetch; /* OBJFETCH_PROC */
1019  BUILDLIST_PROC_NODE buildlist; /* BUILDLIST_PROC */
1020  BUILDVALUE_PROC_NODE buildvalue; /* BUILDVALUE_PROC */
1021  MERGELIST_PROC_NODE mergelist; /* MERGELIST_PROC */
1022  UPDATE_PROC_NODE update; /* UPDATE_PROC */
1023  INSERT_PROC_NODE insert; /* INSERT_PROC */
1024  DELETE_PROC_NODE delete_; /* DELETE_PROC */
1025  CONNECTBY_PROC_NODE connect_by; /* CONNECTBY_PROC */
1026  MERGE_PROC_NODE merge; /* MERGE_PROC */
1027  CTE_PROC_NODE cte; /* CTE_PROC */
1028  } proc;
1029 
1030  double cardinality; /* estimated cardinality of result */
1031 
1032  /* XASL cache related information */
1033  OID creator_oid; /* OID of the user who created this XASL */
1034  int projected_size; /* # of bytes per result tuple */
1035  int n_oid_list; /* size of the referenced OID list */
1036  OID *class_oid_list; /* list of class/serial OIDs referenced in the XASL */
1037  int *class_locks; /* list of locks for class_oid_list. */
1038  int *tcard_list; /* list of #pages of the class OIDs */
1039  const char *query_alias;
1040  int dbval_cnt; /* number of host variables in this XASL */
1042 
1043  int max_iterations; /* Number of maximum iterations (used during run-time for recursive CTE) */
1044 
1045 #if defined (SERVER_MODE) || defined (SA_MODE)
1046  ORDERBY_STATS orderby_stats;
1047  GROUPBY_STATS groupby_stats;
1048  XASL_STATS xasl_stats;
1049 
1050  TOPN_TUPLES *topn_items; /* top-n tuples for orderby limit */
1051 
1052  XASL_STATUS status; /* current status */
1053 #endif /* defined (SERVER_MODE) || defined (SA_MODE) */
1054 };
1055 
1057 {
1058  PRED_EXPR *pred; /* predicate expression */
1059  int num_attrs_pred; /* number of atts from the predicate */
1060  ATTR_ID *attrids_pred; /* array of attr ids from the pred */
1061  HEAP_CACHE_ATTRINFO *cache_pred; /* cache for the pred attrs */
1062  XASL_UNPACK_INFO *unpack_info; /* Buffer information. */
1063 };
1065 
1066 /* TCARD predefined values. Set -1 for no cardinality needed or -2 to mark OID's that are not classes and actually
1067  * belong to serials. */
1068 #define XASL_CLASS_NO_TCARD -1
1069 #define XASL_SERIAL_OID_TCARD -2
1070 
1071 #endif /* _XASL_H_ */
int * mvcc_extra_assign_reev
Definition: xasl.h:243
OUTPTR_LIST * outptr_list
Definition: xasl.h:968
REGU_VARIABLE_LIST prior_regu_list_pred
Definition: xasl.h:427
int num_extra_assign_reev
Definition: xasl.h:242
SORT_LIST * orderby_list
Definition: xasl.h:957
PRED_EXPR * set_pred
Definition: xasl.h:298
VAL_LIST * prior_val_list
Definition: xasl.h:425
REGUVAL_LIST_SPEC_TYPE reguval_list_node
Definition: xasl.h:789
HEAP_CACHE_ATTRINFO * cache_pred
Definition: xasl.h:733
XASL_NODE * fptr_list
Definition: xasl.h:984
TP_DOMAIN * dom
Definition: xasl.h:197
DB_VALUE * save_instnum_val
Definition: xasl.h:981
XASL_NODE_HEADER * xasl_header
Definition: xasl.h:611
ACCESS_SPEC_TYPE * merge_spec
Definition: xasl.h:971
REGU_VARIABLE_LIST cls_regu_list_key
Definition: xasl.h:719
int g_hash_eligible
Definition: xasl.h:330
VAL_LIST * a_val_list
Definition: xasl.h:327
OUTPTR_LIST * a_outptr_list_interm
Definition: xasl.h:326
PRED_EXPR * if_pred
Definition: xasl.h:978
int needs_pruning
Definition: xasl.h:236
BUILDVALUE_PROC_NODE buildvalue
Definition: xasl.h:1020
int val_cnt
Definition: xasl.h:208
QPROC_SINGLE_FETCH
Definition: query_list.h:326
ATTR_ID * attrids_key
Definition: xasl.h:728
int n_oid_list
Definition: xasl.h:1035
INDX_INFO * indexptr
Definition: xasl.h:927
DB_VALUE ** cache_reserved
Definition: xasl.h:738
bool ql_flag
Definition: xasl.h:300
int wait_msecs
Definition: xasl.h:224
int * mvcc_reev_classes
Definition: xasl.h:412
UPDDEL_CLASS_INFO * classes
Definition: xasl.h:407
REGU_VARIABLE * limit_row_count
Definition: xasl.h:983
ATTR_ID * attrids_pred
Definition: xasl.h:1060
bool has_delete
Definition: xasl.h:440
int no_logging
Definition: xasl.h:410
QFILE_LIST_MERGE_INFO ls_merge
Definition: xasl.h:363
REGU_VARIABLE_LIST set_regu_list
Definition: xasl.h:764
int num_assign_reev_classes
Definition: xasl.h:377
SHOWSTMT_TYPE show_type
Definition: xasl.h:758
PRED_EXPR * g_grbynum_pred
Definition: xasl.h:316
int num_val_lists
Definition: xasl.h:399
TARGET_TYPE type
Definition: xasl.h:925
ATTR_ID * attrids_pred
Definition: xasl.h:732
REGU_VARLIST_LIST select_list
Definition: xasl.h:223
XASL_NODE * inner_xasl
Definition: xasl.h:359
REGU_VARIABLE * orderby_limit
Definition: xasl.h:960
int select_list_size
Definition: xasl.h:222
int agg_domains_resolved
Definition: xasl.h:350
QUERY_OPTIONS option
Definition: xasl.h:967
int num_default_expr
Definition: xasl.h:389
UNION_PROC_NODE union_
Definition: xasl.h:1017
int * mvcc_reev_classes
Definition: xasl.h:379
ANALYTIC_EVAL_TYPE * a_eval_list
Definition: xasl.h:322
VALPTR_LIST ** valptr_lists
Definition: xasl.h:400
int projected_size
Definition: xasl.h:1034
int has_uniques
Definition: xasl.h:237
XASL_NODE * update_xasl
Definition: xasl.h:438
MERGELIST_PROC_NODE mergelist
Definition: xasl.h:1021
int cat_fetched
Definition: xasl.h:1001
METHOD_SPEC_TYPE method_node
Definition: xasl.h:788
XASL_NODE * aptr_list
Definition: xasl.h:974
PROC_TYPE type
Definition: xasl.h:953
OID class_oid
Definition: xasl.h:386
UPDDEL_CLASS_INFO * classes
Definition: xasl.h:370
SHOWSTMT_TYPE
int no_logging
Definition: xasl.h:375
DB_VALUE * arg
Definition: xasl.h:297
int num_reev_classes
Definition: xasl.h:411
BUILDLIST_PROC_NODE buildlist
Definition: xasl.h:1019
Definition: xasl.h:189
int * attr_ids
Definition: xasl.h:266
int * att_id
Definition: xasl.h:390
HYBRID_NODE s
Definition: xasl.h:932
UPDATE_PROC_NODE update
Definition: xasl.h:1022
ACCESS_SPEC_TYPE * inner_spec_list
Definition: xasl.h:360
struct qproc_db_value_list * QPROC_DB_VALUE_LIST
Definition: xasl.h:192
XASL_NODE_HEADER header
Definition: xasl.h:951
DELETE_PROC_NODE delete_
Definition: xasl.h:1024
DB_VALUE * g_grbynum_val
Definition: xasl.h:317
int num_attrs_reserved
Definition: xasl.h:739
SELUPD_LIST * selected_upd_list
Definition: xasl.h:969
int is_single_tuple
Definition: xasl.h:965
ACCESS_SCHEMA_TYPE
Definition: xasl.h:703
VAL_LIST * val_list
Definition: xasl.h:972
PRED_EXPR * ordbynum_pred
Definition: xasl.h:958
REGU_VARIABLE_LIST list_regu_list_probe
Definition: xasl.h:751
bool iscan_oid_order
Definition: xasl.h:1041
REGU_VARIABLE_LIST list_regu_list_build
Definition: xasl.h:750
DB_VALUE * val
Definition: xasl.h:196
int no_logging
Definition: xasl.h:396
int ATTR_ID
HEAP_CACHE_ATTRINFO * attr_info
Definition: xasl.h:265
ACCESS_METHOD access
Definition: xasl.h:926
ACCESS_METHOD
Definition: xasl.h:687
SCAN_OPERATION_TYPE scan_op_type
Definition: xasl.h:1005
XASL_NODE * next
Definition: xasl.h:952
HEAP_CACHE_ATTRINFO * cache_rest
Definition: xasl.h:735
bool single_table_opt
Definition: xasl.h:431
DB_VALUE * s_dbval
Definition: xasl.h:934
int flag
Definition: xasl.h:954
XASL_NODE * recursive_part
Definition: xasl.h:447
ACCESS_SPEC_TYPE * next
Definition: xasl.h:935
PRED_EXPR * start_with_pred
Definition: xasl.h:419
QFILE_TUPLE curr_tuple
Definition: xasl.h:432
int num_assigns
Definition: xasl.h:372
XASL_NODE * outer_xasl
Definition: xasl.h:356
ACCESS_SPEC_TYPE * curr_spec
Definition: xasl.h:996
REGU_VARIABLE * func_regu
Definition: xasl.h:277
int ordbynum_flag
Definition: xasl.h:961
CONNECTBY_PROC_NODE connect_by
Definition: xasl.h:1025
XASL_NODE * dptr_list
Definition: xasl.h:976
REGU_VARIABLE_LIST after_cb_regu_list_rest
Definition: xasl.h:430
PRED_EXPR * where_range
Definition: xasl.h:931
PRED_EXPR * cons_pred
Definition: xasl.h:392
int num_vals
Definition: xasl.h:388
INSERT_PROC_NODE insert
Definition: xasl.h:1023
ACCESS_SPEC_FLAG
Definition: xasl.h:711
bool clear_value_at_clone_decache
Definition: xasl.h:255
int xasl_flag
Definition: xasl.h:69
QFILE_LIST_ID * list_id
Definition: xasl.h:955
REGU_VARIABLE_LIST list_regu_list_pred
Definition: xasl.h:748
HEAP_CACHE_ATTRINFO * cache_range
Definition: xasl.h:742
OID class_oid
Definition: xasl.h:220
ACCESS_SPEC_FLAG flags
Definition: xasl.h:937
UPDATE_ASSIGNMENT * assigns
Definition: xasl.h:373
REGU_VARIABLE_LIST cls_regu_val_list
Definition: xasl.h:725
json_table_spec_node json_table_node
Definition: xasl.h:790
int next_scan_on
Definition: xasl.h:998
REGU_VARIABLE_LIST method_regu_list
Definition: xasl.h:770
REGU_VARIABLE * level_regu
Definition: xasl.h:989
SHOWSTMT_SPEC_TYPE showstmt_node
Definition: xasl.h:786
ARITH_TYPE * outarith_list
Definition: xasl.h:348
REGU_VARIABLE_LIST a_regu_list
Definition: xasl.h:323
XASL_NODE * xasl_node
Definition: xasl.h:771
int pruning_type
Definition: xasl.h:398
REGU_VARIABLE * iscycle_regu
Definition: xasl.h:994
PRED_EXPR * after_connect_by_pred
Definition: xasl.h:420
AGGREGATE_HASH_STATE
int g_agg_domains_resolved
Definition: xasl.h:339
DB_VALUE * isleaf_val
Definition: xasl.h:991
int wait_msecs
Definition: xasl.h:374
int next_scan_block_on
Definition: xasl.h:999
LIST_SPEC_TYPE list_node
Definition: xasl.h:785
int * att_id
Definition: xasl.h:235
ATTR_ID * attrids_rest
Definition: xasl.h:734
int ** lob_attr_ids
Definition: xasl.h:240
XASL_NODE * connect_by_ptr
Definition: xasl.h:987
REGU_VARIABLE_LIST regu_list_rest
Definition: xasl.h:424
ACCESS_SCHEMA_TYPE schema_type
Definition: xasl.h:737
REGU_VARIABLE_LIST regu_list_pred
Definition: xasl.h:423
OUTPTR_LIST * a_outptr_list_ex
Definition: xasl.h:325
VAL_LIST * single_tuple
Definition: xasl.h:963
int num_assigns
Definition: xasl.h:263
REGU_VARIABLE_LIST after_cb_regu_list_pred
Definition: xasl.h:429
HFID class_hfid
Definition: xasl.h:221
VAL_LIST * g_val_list
Definition: xasl.h:314
XASL_NODE * insert_xasl
Definition: xasl.h:439
REGU_VARIABLE_LIST list_regu_list_rest
Definition: xasl.h:749
SCAN_OPERATION_TYPE
AGGREGATE_TYPE * agg_list
Definition: xasl.h:347
bool fetch_res
Definition: xasl.h:299
QFILE_LIST_ID * push_list_id
Definition: xasl.h:311
int query_in_progress
Definition: xasl.h:1002
int num_orderby_keys
Definition: xasl.h:376
int num_attrs_key
Definition: xasl.h:730
VALPTR_LIST * valptr_list
Definition: xasl.h:779
OID * class_oid
Definition: xasl.h:232
FETCH_PROC_NODE fetch
Definition: xasl.h:1018
AGGREGATE_TYPE * g_agg_list
Definition: xasl.h:318
int num_attrs_rest
Definition: xasl.h:736
PRED_EXPR * where_pred
Definition: xasl.h:930
PRED_EXPR * after_join_pred
Definition: xasl.h:977
CTE_PROC_NODE cte
Definition: xasl.h:1027
XASL_NODE * eptr_list
Definition: xasl.h:308
OID creator_oid
Definition: xasl.h:1033
PRED_EXPR * cons_pred
Definition: xasl.h:371
int g_grbynum_flag
Definition: xasl.h:328
double cardinality
Definition: xasl.h:1030
int g_output_first_tuple
Definition: xasl.h:331
XASL_NODE * left
Definition: xasl.h:289
const char * query_alias
Definition: xasl.h:1039
VAL_LIST * outer_val_list
Definition: xasl.h:358
XASL_NODE * right
Definition: xasl.h:290
OUTPTR_LIST * prior_outptr_list
Definition: xasl.h:426
int instnum_flag
Definition: xasl.h:997
DB_VALUE * level_val
Definition: xasl.h:988
int buffer_size
Definition: xasl.h:614
OID * class_oid_list
Definition: xasl.h:1036
OUTPTR_LIST * g_outptr_list
Definition: xasl.h:312
XASL_NODE * xasl_node
Definition: xasl.h:753
PRED_EXPR * having_pred
Definition: xasl.h:345
DB_VALUE * ordbynum_val
Definition: xasl.h:959
XASL_NODE * scan_ptr
Definition: xasl.h:985
SORT_LIST * after_groupby_list
Definition: xasl.h:310
ACCESS_SPEC_TYPE * spec_list
Definition: xasl.h:970
ODKU_INFO * odku
Definition: xasl.h:393
SELUPD_LIST * next
Definition: xasl.h:219
int num_subclasses
Definition: xasl.h:231
OUTPTR_LIST * a_outptr_list
Definition: xasl.h:324
int num_classes
Definition: xasl.h:408
int mvcc_reev_extra_cls_cnt
Definition: xasl.h:1008
int hash_list_scan_yn
Definition: xasl.h:752
QPROC_DB_VALUE_LIST valp
Definition: xasl.h:207
QFILE_LIST_ID * input_list_id
Definition: xasl.h:421
REGU_VARIABLE_LIST g_hk_scan_regu_list
Definition: xasl.h:319
char * QFILE_TUPLE
Definition: query_list.h:281
OUTPTR_LIST * cls_output_val_list
Definition: xasl.h:724
int * num_lob_attrs
Definition: xasl.h:239
class regu_variable_node REGU_VARIABLE
Definition: regu_var.hpp:64
HEAP_CACHE_ATTRINFO * cache_attrinfo
Definition: xasl.h:278
REGU_VARIABLE_LIST g_hk_sort_regu_list
Definition: xasl.h:320
PRED_EXPR * where_key
Definition: xasl.h:929
UPDATE_ASSIGNMENT * assignments
Definition: xasl.h:264
int upd_del_class_cnt
Definition: xasl.h:1006
REGU_VARIABLE_LIST cls_regu_list_pred
Definition: xasl.h:720
DB_VALUE * grbynum_val
Definition: xasl.h:346
REGU_VARIABLE * regu_var
Definition: xasl.h:254
XASL_ID * xasl_id
Definition: xasl.h:610
PRED_EXPR * cons_pred
Definition: xasl.h:262
PRED_EXPR * pred
Definition: xasl.h:1058
char * buffer
Definition: xasl.h:613
SET_SPEC_TYPE set_node
Definition: xasl.h:787
PROC_TYPE
Definition: xasl.h:172
OID cls_oid
Definition: xasl.h:727
HFID * class_hfid
Definition: xasl.h:233
REGU_VARIABLE_LIST cls_regu_list_rest
Definition: xasl.h:721
int has_uniques
Definition: xasl.h:394
PRED_EXPR * instnum_pred
Definition: xasl.h:979
int dbval_cnt
Definition: xasl.h:1040
QPROC_DB_VALUE_LIST next
Definition: xasl.h:195
REGU_VARIABLE_LIST prior_regu_list_rest
Definition: xasl.h:428
VAL_LIST * merge_val_list
Definition: xasl.h:973
int wait_msecs
Definition: xasl.h:409
int wait_msecs
Definition: xasl.h:395
ATTR_ID * attrids_range
Definition: xasl.h:741
SORT_LIST * groupby_list
Definition: xasl.h:309
HFID hfid
Definition: xasl.h:726
int * class_locks
Definition: xasl.h:1037
REGU_VARIABLE_LIST cls_regu_list_range
Definition: xasl.h:722
REGU_VARIABLE_LIST arg_list
Definition: xasl.h:759
REGU_VARIABLE * limit_offset
Definition: xasl.h:982
QFILE_LIST_ID * start_with_list_id
Definition: xasl.h:422
REGU_VARIABLE_LIST g_regu_list
Definition: xasl.h:313
QPROC_SINGLE_FETCH single_fetch
Definition: xasl.h:933
REGU_VARIABLE_LIST g_scan_regu_list
Definition: xasl.h:321
PRED_EXPR * g_having_pred
Definition: xasl.h:315
XASL_NODE * bptr_list
Definition: xasl.h:975
ACCESS_SPEC_TYPE * outer_spec_list
Definition: xasl.h:357
HEAP_CACHE_ATTRINFO * cache_key
Definition: xasl.h:729
int max_iterations
Definition: xasl.h:1043
Definition: xasl.h:186
TARGET_TYPE
Definition: xasl.h:675
VAL_LIST * inner_val_list
Definition: xasl.h:361
int pruning_type
Definition: xasl.h:936
DB_VALUE * iscycle_val
Definition: xasl.h:993
MERGE_PROC_NODE merge
Definition: xasl.h:1026
METHOD_SIG_LIST * method_sig_list
Definition: xasl.h:774
DB_VALUE ** output_columns
Definition: xasl.h:306
DB_VALUE * instnum_val
Definition: xasl.h:980
SORT_LIST * after_iscan_list
Definition: xasl.h:956
int num_classes
Definition: xasl.h:369
int num_attrs_pred
Definition: xasl.h:731
int num_attrs_range
Definition: xasl.h:743
HFID class_hfid
Definition: xasl.h:387
REGU_VARIABLE * isleaf_regu
Definition: xasl.h:992
REGU_VARIABLE_LIST cls_regu_list_reserved
Definition: xasl.h:740
XASL_NODE * non_recursive_part
Definition: xasl.h:446
int num_reev_classes
Definition: xasl.h:378
HEAP_CACHE_ATTRINFO * cache_pred
Definition: xasl.h:1061
DB_VALUE ** vals
Definition: xasl.h:391
REGU_VARIABLE * set_ptr
Definition: xasl.h:765
bool g_with_rollup
Definition: xasl.h:329
int * tcard_list
Definition: xasl.h:1038
DB_VALUE * constant
Definition: xasl.h:253
int do_replace
Definition: xasl.h:397
DB_VALUE * obj_oid
Definition: xasl.h:401
XASL_UNPACK_INFO * unpack_info
Definition: xasl.h:1062
CLS_SPEC_TYPE cls_node
Definition: xasl.h:784
QUERY_OPTIONS