.nf
 
 .nf

    ========== licence begin  GPL
    Copyright (c) 1999-2005 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

 
.fo
*****************************************************
Copyright (c) 1999-2005 SAP AG
SAP Database Technology
 
Release :      Date : 2000-11-27
*****************************************************
modname : GAK70
changed : 2000-11-27
module  : AK_strategy_const_type
 
Author  : GertG
Created : 1985-10-16
*****************************************************
 
Purpose : Const und Type fuer die AK_Schicht, die Strategie betreffend.
 
Define  :
 
.CM *-END-* define --------------------------------------
***********************************************************
Use     :
 
.CM *-END-* use -----------------------------------------
***********************************************************
Synonym :
 
.CM *-END-* synonym -------------------------------------
***********************************************************
.CM -lll-
Code    :
 
 
CONST
      (* fraction of pages to be searched for    *)
      (* evaluating a IN-cond on single keyfield *)
      cak70_kin_stratconst      =           0;
      cak70_maxstrats           =         127  (* csp_maxint1 *);
      cak70_max_predicates      =          10;
      cak70_max_L1terms         =           2;
      cak70_max_L2preds_L3terms =          50;
      MAX_COLBUF_IDX_AK70  =
            ( 2*MAX_COL_SEQUENCE_GG00 + 2*MAX_STRATEGY_KEYS_GG04) - 1;
      MAX_QUALIFICATIONS_AK70   =   512;
      MAX_INVPOSARR_IDX_AK70    =   MAX_QUALIFICATIONS_AK70 - 1;
      MAX_INVINPOSARR_IDX_AK70  =   MAX_QUALIFICATIONS_AK70 - 1;
      MAX_INVROOT_IDX_AK70      =   MAX_INV_PER_TAB_GG00; (* PTS 1124453 E.Z. *)
      MAX_L1TERMS_IDX_AK70      =   cak70_max_L1terms - 1;
      MAX_L2PREDS_L3TERMS_IDX_AK70 = cak70_max_L2preds_L3terms - 1;
      MAX_PREDICATES_IDX_AK70   =   cak70_max_predicates - 1;
 
TYPE
      (*---------------- basic types ---------------------*)
      tak70_backup = ( bckp_save, bckp_restore );
 
      tak70_in_record  =  RECORD
            in_stpos   : tsp00_Int2;
            in_elemcnt : tsp00_Int2;
      END;
 
      tak70_sequence_property = (
            sp_exact_match,
            sp_exact_IN_SUBQ_match,
            sp_IN_usage,
            sp_IN_usage_start,
            sp_IN_usage_stop,
            sp_SUBQ_usage,
            sp_SUBQ_usage_start,
            sp_SUBQ_usage_stop,
            sp_first_row_start,
            sp_first_row_stop,
            sp_unused2,
            sp_unused3,
            sp_unused4,
            sp_unused5,
            sp_unused6,
            sp_unused7);
      tak70_sequence_properties = SET OF tak70_sequence_property;
 
      tak70_one_strat  =  RECORD
            ostr_wholeIO_pages    : tsp00_Int4;
            ostr_readIO_pages     : tsp00_Int4;
            ostr_readIO_rows      : tsp00_Int4;
            ostr_readIO_primpages : tsp00_Int4;
            ostr_strat_value      : tsp00_Longreal;
            ostr_strategy         : tgg07_StratEnum;
            ostr_filler1          : tsp00_C1;
            ostr_filler2          : tsp00_Int2;
            CASE tgg07_StratEnum OF
                strat_key_range,
                strat_key_equal,
                strat_key_subq,
                strat_key_in :
                    (ostr_key_in_range       : tgg07_StrKeyInRange);
                strat_inv_range,
                strat_inv_in,
                strat_inv_subq :
                    (ostr_inv_in_range       : tgg07_StrInvInRange);
                strat_undecided :
                    (ostr_raw                : tgg07_StrRaw);
                END;
            (*ENDCASE*) 
            (*------------- combined types ---------------------*)
 
 
      tak70_key_access = RECORD
            ka_startfields : tgg07_ColPosArr;
            ka_stopfields  : tgg07_ColPosArr;
            ka_startcnt    : tsp00_Int2;
            ka_stopcnt     : tsp00_Int2;
            ka_infield     : tak70_in_record;
            ka_SUBQ_idx    : tsp00_Int2;
            ka_sequence_props   : tak70_sequence_properties;
      END;
 
      tak70_Invposarr = PACKED ARRAY [ 0..MAX_INVPOSARR_IDX_AK70 ] OF tsp00_Int2;
      (**)
      (**)
      tak70_InvInposarr =
            PACKED ARRAY [ 0..MAX_INVINPOSARR_IDX_AK70 ] OF tak70_in_record;
 
      tak70_index_access = RECORD
            ia_startfields  : tak70_Invposarr;
            ia_stopfields   : tak70_Invposarr;
            ia_infields     : tak70_InvInposarr;
            ia_inv_root         : ARRAY [ 0..MAX_INVROOT_IDX_AK70 ]
                  OF tsp00_PageNo;
            ia_startcnt     : tsp00_Int2;
            ia_stopcnt      : tsp00_Int2;
            ia_incnt        : tsp00_Int2;
            ia_sequence_props   : tak70_sequence_properties;
      END;
 
      tak70_all_colbuf =
            PACKED ARRAY [ 0..MAX_COLBUF_IDX_AK70] OF tsp00_Int2;
 
      tak70_involved_columns = RECORD
            ic_i_outp_cnt : tsp00_Int2;
            ic_i_qual_cnt : tsp00_Int2;
            ic_k_outp_cnt : tsp00_Int2;
            ic_k_qual_cnt : tsp00_Int2;
            CASE boolean OF
                true :
                    (ic_i_outp_cols : tak_colsequence;
                    ic_i_qual_cols  : tak_colsequence;
                    ic_k_outp_cols  : tgg07_ColPosArr;
                    ic_k_qual_cols  : tgg07_ColPosArr);
                false :
                    (ic_all_colbuf  : tak70_all_colbuf);
                END;
            (*ENDCASE*) 
 
      tak70_write_needings = ( write_nothing, write_keylist, write_result );
      (**)
      tak70_query_property = (
            qp_missing_value,
            qp_inv_only_impossible,
            qp_no_result_set,
            qp_build_result,
            qp_given_rescnt_param,
            qp_given_rescnt,
            qp_check_order_support,
            qp_correlation_key,
            qp_check_key_MIN_MAX_opt,
            qp_check_inv_MIN_MAX_opt,
            qp_check_key_inv_MIN_MAX_opt,
            qp_auto_distinct,
            qp_only_keyseq_in_output,
            qp_archive_access,
            qp_aggr_optim_poss,
            qp_ROWNO_limit,
            qp_unused20,
            qp_unused21,
            qp_unused22,
            qp_unused23,
            qp_unused24,
            qp_unused25,
            qp_unused26,
            qp_unused27,
            qp_unused30,
            qp_unused31,
            qp_unused32,
            qp_unused33,
            qp_unused34,
            qp_unused35,
            qp_unused36,
            qp_unused37);
 
      tak70_query_properties = RECORD
            qps_rescnt      : tsp00_Int4;
            qps_switches    : SET OF tak70_query_property;
      END;
 
 
      tak70_strategy_record  =  RECORD
            srec_config             : tak00_access_configuration;
            srec_keyaccess          : tak70_key_access;
            srec_invaccess          : tak70_index_access;
            srec_involved_cols      : tak70_involved_columns;
            srec_query_prop         : tak70_query_properties;
            srec_primpages          : tsp00_Int4;
            srec_primrows           : tsp00_Int4;
            srec_readIO_rows_min    : tsp00_Int4;
            srec_readIO_pages_min   : tsp00_Int4;
            srec_L1_pred_cnt        : tsp00_Int2;
            srec_unusable_L1_pred   : boolean;
            srec_L23_predicates     : boolean;
            srec_L1_strategy        : boolean;
            srec_strat_cachable     : boolean;
      END;
 
      tak70_stratrec_ptr = ^tak70_strategy_record;
 
      tak70_one_strat_ref  =  RECORD
            osr_stratpos    : tsp00_Int4;
            osr_stratlen    : tsp00_Int2;
            osr_strategy    : tgg07_StratEnum;
            osr_filler      : boolean;
      END;
 
 
      tak70_all_strat  =  RECORD
            ast_strats           : ARRAY [ 1..cak70_maxstrats ]
                  OF tak70_one_strat_ref;
            ast_key_range        : tgg07_StrKeyInRange;
            ast_cntstrats        : tsp00_Int2;
            ast_key_range_poss   : boolean;
            ast_init_key_range   : boolean;
            ast_wholeIO_pages    : tsp00_Int4;
            ast_readIO_pages     : tsp00_Int4;
            ast_readIO_rows      : tsp00_Int4;
            ast_readIO_primpages : tsp00_Int4;
      END;
 
 
      tak70_one_predicate  =  PACKED RECORD
            pred_start      : tsp00_Int2;
            pred_stop       : tsp00_Int2;
            pred_key        : boolean;
            pred_inv        : boolean;
            pred_fill       : tsp00_Int2;
      END;
 
 
      tak70_L2_pred_L3_term  =  RECORD
            l2l3p_preds    : ARRAY [ 0..MAX_PREDICATES_IDX_AK70 ]
                  OF tak70_one_predicate;
            l2l3p_predcnt  : tsp00_Int2;
            l2l3p_fill1    : tsp00_Int2;
            l2l3p_fill2    : tsp00_Int2;
            l2l3p_fill3    : tsp00_Int2;
      END;
 
 
      tak70_L1_term  =  RECORD
            l1t_L2terms : ARRAY [ 0..MAX_L2PREDS_L3TERMS_IDX_AK70 ]
                  OF tak70_L2_pred_L3_term;
            l1t_L2pL3tcnt  : tsp00_Int2;
            l1t_is_usable  : boolean;
            l1t_fill1      : boolean;
            l1t_fill2      : tsp00_Int2;
            l1t_fill3      : tsp00_Int2;
      END;
 
 
      tak70_term  =  RECORD
            trm_L1terms   : ARRAY [ 0..MAX_L1TERMS_IDX_AK70 ] OF tak70_L1_term;
            trm_L1termcnt : tsp00_Int2;
            trm_fill1     : tsp00_Int2;
            trm_fill2     : tsp00_Int4;
      END;
 
 
      tak70_all_key_record  =  RECORD
            akr_startcnt    : tsp00_Int2;
            akr_stopcnt     : tsp00_Int2;
            akr_startkeys   : tgg07_ColPosArr;
            akr_stopkeys    : tgg07_ColPosArr;
      END;
 
      tak70_l2l3_strat_status = (
            lss_several_strats,
            lss_one_key_range,
            lss_use_L1_strat);
 
      tak70_optimizer_parsinfo  =  RECORD
      (* describe L1 key access path *)
            op_keystartcnt            : tsp00_Int2;
            op_keystopcnt             : tsp00_Int2;
            op_keyinfield             : tak70_in_record;
            (* describe L1 index access path *)
            op_idx_startcnt           : tsp00_Int2;
            op_idx_stopcnt            : tsp00_Int2;
            op_idx_incnt              : tsp00_Int2;
            (* describe L2L3 access path *)
            op_L1termcnt              : tsp00_Int2;
            (* describe query properties *)
            op_query_prop             : tak70_query_properties;
            (* involved column info *)
            op_i_outp_cnt             : tsp00_Int2;
            op_i_qual_cnt             : tsp00_Int2;
            op_k_outp_cnt             : tsp00_Int2;
            op_k_qual_cnt             : tsp00_Int2;
            (* ordered field count *)
            op_ordered_field_cnt      : tsp00_Int2;
            (* context information about command *)
            op_L1_pred_cnt            : tsp00_Int2;
            op_unusable_L1_pred       : boolean;
            op_L23_predicates         : boolean;
            (*  *)
            op_filler1                : tsp00_Int2;
      END;
 
      tak70_optimizer_parsinfo_ptr  =  ^tak70_optimizer_parsinfo;
 
      tak70_stratinforecord  =  RECORD
            si_reclen                 : tsp00_Int2;
            si_keylen                 : tsp00_Int2;
            si_varcol_offset          : tsp00_Int2;
            si_varcol_cnt             : tsp00_Int2;
            si_surrogate              : tgg00_Surrogate;
            si_entrytype              : tsp00_C2;
            si_segno                  : tsp00_Int2;
            si_fullen                 : tsp00_Int4;
            si_gg_stratinfo           : tgg07_StrategyInfo;
      END;
 
 
      tak70_col_sort_record =  RECORD
            col_id             : tsp00_Int2;
            col_next_id_offset : tsp00_Int2;
            col_stpos          : tsp00_Int2;
            col_in_valcnt      : tsp00_Int2;
            col_eop            : tgg00_StackOpType;
            col_subq           : boolean;
            col_isdesc         : boolean;
      END;
 
      tak70_sort_col_arr = ARRAY[ 1..MAX_STRATEGY_KEYS_GG04 ]
            OF tak70_col_sort_record;
 
      tak70_eval_rec = RECORD
            er_strat_value   : tsp00_Longreal;
            er_read_pages    : tsp00_Int4;
            er_read_primrows : tsp00_Int4;
      END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
