/* @lastChanged: "1999-02-03  16:24"
 
 * @filename:   ggg07
 * @purpose:    "GG_strategy_constants_and_types"
 * @release:    7.2.0.0
 * @see:        "-.-"
 *
 * @copyright:  (c) 1999-2004 SAP AG"
 */
 
.tt 1 $SAP$LiveCache$GGG07$
.tt 3 $$GG_strategy_constants_and_types$2000-11-23$
 
.nf
 
 
    ========== licence begin  GPL
    Copyright (c) 1999-2004 SAP AG
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end
 
.fo
***********************************************************
 
Module  : GG_strategy_constants_and_types
 
Define  :
 
.CM *-END-* define --------------------------------------
 
Use     :
 
.CM *-END-* use -----------------------------------------
 
Synonym :
 
.CM *-END-* synonym -------------------------------------
 
 
Release :      Date : 2000-11-23
 
***********************************************************
 
Specification:
 
.CM *-END-* specification -------------------------------
 
***********************************************************
 
Description:
 
 
.CM *-END-* description ---------------------------------
 
***********************************************************
 
Structure:
 
.CM *-END-* structure -----------------------------------
 
**********************************************************
 
.CM -lll-
Code    :
 
 
CONST
      STRINVINRANGE_START_MXGG07 =  32; (* header of tgg07_StrInvInRange without keys *)
      STRATEGY_START_MXGG07      =  76; (* StrategyInf - str_catalog *)
      (**)
      INV_DISTINCT_OPTIM_GG07    = -2;
      AUTO_DISTINCT_OPTIM_GG07   =  1;
      NO_DISTINCT_OPTIM_GG07     =  0;
      KEYSEQLEN_OFFSET_GG07      =  MAX_KEYLEN_GG00 + 1;
      (**)
      (* PTS 1111217 E.Z. *)
      MAX_STRATETGY_LEN_GG07     = 236;
      (**)
      MAX_COLPOSARR_IDX_GG07     = MAX_STRATEGY_KEYS_GG04 - 1;
      (**)
      NOT_SEQUENCED_GG07         = -5;
      IS_UNDEFINED_GG07          = -9999;
      VARKEY_GG07                = chr(255);
      cgg07_left_len_eq_right_len  = 0;
      cgg07_left_len_lt_right_len  = 1;
      cgg07_left_len_gt_right_len  = 2;
 
TYPE
      tgg07_ColPosArr     = ARRAY [0..MAX_COLPOSARR_IDX_GG07] OF tsp00_Int2;
      (**)
      tgg07_SubqKind = ( no_subquery, query_in_subq, normal_subquery);
      (**)
      tgg07_StrRaw = ARRAY[1..MAX_STRATETGY_LEN_GG07] OF tsp00_C1;
      (**)
      tgg07_InvColSet = PACKED SET OF 1..MAX_COL_SEQUENCE_GG00;
      (**)
      tgg07_keystrat_props = (
            ksp_exact_match,
            ksp_exact_IN_SUBQ_match,
            ksp_order_support,
            ksp_aggr_MIN_opt,
            ksp_aggr_MAX_opt);
 
      tgg07_StrKeyInRange = RECORD
            skir_keystart      : tgg07_ColPosArr;
            skir_keystop       : tgg07_ColPosArr;
            skir_IN_SUBQ_stpos : tsp00_Int2;
            skir_inelemcnt     : tsp00_Int2;
            skir_strat_props   : SET OF tgg07_keystrat_props;
            skir_filler        : tsp00_C3;
      END;
 
      tgg07_invstrat_props = (
            isp_exact_match,
            isp_exact_IN_SUBQ_match,
            isp_unique_idx,
            isp_inv_only,
            isp_order_support,
            isp_listmerge_allowed,
            isp_aggr_MIN_opt,
            isp_aggr_MIN_opt_reverse,
            isp_aggr_MAX_opt,
            isp_aggr_MAX_opt_reverse,
            isp_aggr_optim,
            isp_pure_inv_output,
            isp_unused2,
            isp_unused3,
            isp_unused4,
            isp_unused5);
 
      tgg07_StrInvInRange = RECORD
            siir_keystart      : tgg07_ColPosArr;
            siir_keystop       : tgg07_ColPosArr;
            siir_invstart      : tgg07_ColPosArr;
            siir_invstop       : tgg07_ColPosArr;
            siir_startcnt      : tsp00_Int2;
            siir_stopcnt       : tsp00_Int2;
            siir_invroot       : tsp00_PageNo;
            siir_indexno       : tsp00_Int2;
            siir_icount        : tsp00_Int2;
            siir_invcoldesc    : tgg07_InvColSet;
            siir_invlen        : tsp00_Int2;
            siir_inelemcnt     : tsp00_Int2;
            siir_subq_idx      : tsp00_Int2;
            siir_out_invseqlen : tsp00_Int2;
            siir_IN_SUBQ_stpos : tsp00_Int2;
            siir_MIN_recpos    : tsp00_Int2;
            siir_MAX_recpos    : tsp00_Int2;
            siir_strat_props   : SET OF tgg07_invstrat_props;
            siir_filler        : tsp00_C2;
      END;
 
 
      tgg07_StrJoinMultFields = RECORD
            sjmf_keystart  : tgg07_ColPosArr;
            sjmf_keystop   : tgg07_ColPosArr;
            sjmf_invroot   : tsp00_PageNo;
            sjmf_index_no  : tsp00_Int2;
            sjmf_cntfields : tsp00_Int2;
            sjmf_invlen    : tsp00_Int4;
      END;
 
 
      tgg07_StrJoinViewkey = RECORD
            sjv_lastkeylen : tsp00_Int2;
            sjv_minkeylen  : tsp00_Int2;
            sjv_filler     : tsp00_Int4;
      END;
 
 
      tgg07_StrCatalog = RECORD
            scat_show_kind  : tgg00_ShowKind;
            scat_upd_strat  : boolean;
            scat_authname   : tsp00_Int2;
            scat_tablename  : tsp00_Int2;
            scat_username   : tsp00_Int2;
            scat_columnname : tsp00_Int2;
            scat_fill2      : tsp00_Int2;
            scat_col_needed : ARRAY[1..MAX_SHOW_COLUMNS_GG04] OF boolean;
            scat_qual_cols  : ARRAY[1..MAX_SHOW_COLUMNS_GG04] OF boolean;
            scat_dblink     : tsp00_KnlIdentifier;
      END;
 
      tgg07_StratEnum = (
            strat_viewkey,
            strat_key_equal,
            strat_key_equal_sub,
            strat_key_in,
            (***)
            strat_key_range,
            strat_key_range_sub,
            (***)
            strat_inv_range,
            strat_inv_range_sub,
            strat_inv_in,
            (***)
            strat_undecided,
            (***)
            strat_key_range_fetch,
            strat_inv_range_fetch,
            strat_inv_range_merge_fetch,
            (***)
            strat_join_key_equal,
            strat_join_key_next,
            strat_join_all_keys_equal,
            strat_join_key_range,
            strat_join_viewkey,
            strat_join_inv,
            strat_join_all_inv_equal,
            strat_join_inv_range,
            (***)
            strat_more_than_one,
            (***)
            strat_no_result,
            (***)
            strat_catalog);
      (**)
      tgg07_StratEnumSet = SET OF tgg07_StratEnum;
      tgg07_StratAccessModEnum = (
            strmod_hash,
            strmod_parallel);
      tgg07_StratAccessModSet = SET OF tgg07_StratAccessModEnum;
 
      tgg07_StrategyInfo = RECORD
            str_result_id          : tgg00_FileId;
            str_strategy           : tgg07_StratEnum;
            str_build_result       : boolean;
            str_distinc            : tgg04_Distinct;
            str_ordering           : boolean;
            str_use_rowno          : boolean;
            str_use_subquery       : tgg07_SubqKind;
            str_corr_single        : boolean;
            str_union_kind         : tsp00_Uint1;
            str_res_possible       : boolean;
            str_use_order          : boolean;
            str_out_keyseqlen      : tsp00_Int2;
            str_qual_kind          : tgg00_QualKind;
            str_cnt_strat          : tsp00_Uint1;
            str_rowno              : tsp00_Int2;
            str_foundresults       : tsp00_Int4;
            str_key_len            : tsp00_Int2;
            str_rec_len            : tsp00_Int2;
            str_union_key_cnt_offs : tsp00_Int4;
            str_stack_output_offs  : tsp00_Int2;
            str_search_first       : boolean;
            str_all_files          : boolean;
            str_key_order_support  : boolean;
            str_selinto            : boolean;
            str_access_mod         : tgg07_StratAccessModSet; (* PTS 1127791 M.Ki. *)
            str_filler             : boolean;
            CASE tgg07_StratEnum OF
            (* every structure length has to multiple of 8 *)
            (* length MOD 8 = 0                            *)
                strat_key_equal,
                strat_key_equal_sub,
                strat_key_in,
                strat_key_range_fetch,
                strat_key_range,
                strat_key_range_sub:
                    (str_key_in_range    : tgg07_StrKeyInRange)
                          ;
                strat_inv_range,
                strat_inv_in,
                strat_inv_range_sub,
                strat_inv_range_fetch,
                strat_inv_range_merge_fetch:
                    (str_inv_in_range    : tgg07_StrInvInRange)
                          ;
                strat_join_inv,
                strat_join_all_keys_equal,
                strat_join_key_range,
                strat_join_all_inv_equal,
                strat_join_inv_range:
                    (str_join_multfields : tgg07_StrJoinMultFields)
                          ;
                strat_join_viewkey:
                    (str_join_viewkey    : tgg07_StrJoinViewkey)
                          ;
                strat_catalog:
                    (str_catalog         : tgg07_StrCatalog);
                strat_viewkey,
                strat_undecided:
                    (str_raw             : tgg07_StrRaw);
                END;
            (*ENDCASE*) 
 
 
      tgg07_selectstrat_rec = RECORD
            ssr_old_strategynum : tgg07_StratEnum;
            ssr_new_strategynum : tgg07_StratEnum;
            ssr_invlen          : tsp00_Int2;
            ssr_filler          : tsp00_Int2;
      END;
 
      tgg07_OJoinFieldSet = PACKED SET OF 0..MAX_JOINS_GG04;
 
      tgg07_KbOneJoinInfo = PACKED RECORD
            kboj_recpos           : tsp00_Int2;
            kboj_len              : tsp00_Int2;
            kboj_op               : tgg00_StackOpType;
            kboj_reverse_operands : boolean;
            kboj_fill2            : tsp00_Int2;
      END;
 
 
      tgg07_KbJoinInfo = RECORD
            kbji_parts : ARRAY [1..2] OF tgg07_KbOneJoinInfo;
      END;
 
 
      tgg07_KbJoinRec = RECORD
            kbjr_jointrans_cnt  : tsp00_Uint1;
            kbjr_filler1        : tsp00_Uint1;
            kbjr_left_oj        : boolean;
            kbjr_right_oj       : boolean;
            kbjr_lof            : tgg07_OJoinFieldSet;
            kbjr_rof            : tgg07_OJoinFieldSet;
            kbjr_jarr           : ARRAY [1..MAX_JOINS_GG04] OF tgg07_KbJoinInfo;
      END;
 
 
      tgg07_JoinColCopy = PACKED RECORD
            jfrom  : tsp00_Int2;
            jto    : tsp00_Int2;
            jlen   : tsp00_Int2;
            jfill1 : tsp00_Int2;
      END;
 
      tgg07_JoinColCopyArr = ARRAY [1..MAX_JOINS_GG04] OF tgg07_JoinColCopy;
 
      tgg07_JoinColCopyInfo = RECORD
            n_j_cnt  : tsp00_Int2;
            n_j_fill : tsp00_Int2;
            n_j_arr  : tgg07_JoinColCopyArr
      END;
 
 
      tgg07_JoinResInfo = RECORD
            o_tree        : tgg00_FileId;
            o_recl        : tsp00_Int2;
            o_keyl        : tsp00_Int2;
            n_rec_len     : tsp00_Int2;
            n_key_len     : tsp00_Int2;
            n_res_rec_len : tsp00_Int2;
            n_filler1     : tsp00_Int2;
      END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
