1 /* BEGIN mrds_search_ops.incl.pl1 -- 2/23/79 */
  2 
  3 /* HISTORY:
  4 
  5    81-06-01 Jim Gray : removed assn_type and len from the  move_info
  6    structure, since these are not used with the advent of mu_covert.
  7 
  8    81-06-30 Jim Gray : added range_val_ptr to  init_info  structure,
  9    so  that  ranges  (10  <  x < 20) could be handled in one call to
 10    vfile select, instead of two. Also added range bit to  show  when
 11    usable.
 12 
 13    81-07-06 Jim Gray : changed init_info op type encodings for those
 14    access  methods  currently available in mrds, plus added bits for
 15    whether mrds or vfile needs to  do  tid  list  intersection,  and
 16    whether an unordered, faster sequential search can be done.
 17 
 18    81-07-18 Jim Gray : added many comments, after changing the named
 19    constants to refer to the new access methods.
 20 
 21    82-09-01 Mike Kubicar : converted from tuple structure to vector
 22    structure.  This meant changing fields which pointed directly to
 23    tuple space to use indices into the tuple_info structure instead.
 24 
 25    82-10-01 Davids: removed the encd_hash flag from move_info since it
 26    is never used and removed the encd_index flag from move_info since
 27    changes to mrds_dsl_gen_srch_prog have rendered it obsolute. Increased
 28    size of the reserved element from 28 to 30 bits.
 29 
 30    83-04-04 Mike Kubicar : Removed init_info.unordered.  It is no longer
 31    used.
 32 
 33    83-04-22 Mike Kubicar : Added search_specification_ptr to select_info.
 34    This is the search spec to be used when retrieving tuple from a relation.
 35    Also deleted the init_info strucuture and associated constants.  It is no
 36    longer used.
 37 
 38    83-05-31 Mike Kubicar : Renamed search_specification_ptr to
 39    relation_search_specification_ptr.
 40 
 41 */
 42 
 43 
 44 /* DESCRIPTION:
 45 
 46                           BEGIN_DESCRIPTION
 47 
 48    The search ops structure holds the  operations  to  be  performed
 49    during   a   search   of  the  database.  It  is  a  step-by-step
 50    actuallization of the selection expression specified by the user.
 51    For each tuple variable, there will be an move-init-select set of
 52    operations. The first operations is always an initizization~  one
 53    called  PICKUP_SVP,  The  last  operation  is always a case for a
 54    failure condition called RETNUL, to return  tuple_not_found.  The
 55    move_init_select groups each have their own RETVAl step to return
 56    a tuple, if they succeed in finding an acceptable tuple. If there
 57    are multiple tuple variables, each T.V. group calls the move step
 58    of the next group once it has found an acceptable tuple in  order
 59    to  satisfy  all conditions of the and group. Multiple and groups
 60    are processed until they exhaust all  possible  tuple  variables,
 61    before the mini-search for the next and group is called.
 62 
 63                            END_DESCRIPTION
 64 */
 65 
 66 dcl 1 search_ops aligned based (so_ptr),                    /* the search "program" */
 67     2 ic fixed bin,                                         /* index to next instruction */
 68     2 nops fixed bin,                                       /* no. of operations in list */
 69     2 op (so_nops_init refer (search_ops.nops)),
 70       3 code fixed bin,                                     /* op code
 71                                                                1 => init. range
 72                                                                2 => move values
 73                                                                3 => select tuple
 74                                                                4 => return value
 75                                                                5 => return null
 76                                                                6 => pick up new search vars ptr */
 77       3 var_ind fixed bin,                                  /* index of tuple variable */
 78       3 good_xfer fixed bin,                                /* rel. index of instr. if this op. successful */
 79       3 err_xfer fixed bin,                                 /* rel. index of instr. if this op is unsuccess. */
 80       3 info_ptr ptr;                                       /* pointer to op. dependent info. */
 81 
 82 dcl  so_ptr ptr;
 83 dcl  so_nops_init fixed bin;
 84 
 85 dcl ((INIT init (1)),
 86     (MOVE init (2)),
 87     (SEL init (3)),
 88     (RETVAL init (4)),
 89     (RETNUL init (5)),
 90     (PICKUP_SVP init (6))) fixed bin int static options (constant);
 91 
 92 /* the move info structure is used to obtain needed information
 93    for the next database access specified by the init_info.
 94    This may involve moving data from tuples in other tuple variable relations
 95    in the database, doing a data conversion to a needed data type,
 96    encoding the data for key usage, or evaluating an expression */
 97 
 98 dcl 1 move_info aligned based (mi_ptr),                     /* info for move op. */
 99                                                             /* note: items must be processed in order since
100                                                                items may depend on prior items in list */
101     2 bit_move bit (1) unal,                                /* if just straight move */
102     2 var_move bit (1) unal,                                /* if straignt move of var len attr. */
103     2 thread bit (1) unal,                                  /* on if moving thread */
104     2 expr bit (1) unal,                                    /* if evaluating an expr. */
105     2 encd_attr bit (1) unal,                               /* if encoding a comparison value */
106     2 extr_attr bit (1) unal,                               /* if the value must be extracted from a tuple */
107     2 reserved bit (30) unal,
108     2 var_ind fixed bin,                                    /* index of source var, or 0 */
109     2 tuple_var_index fixed bin,                            /* index of tuple variable (tuple_info.tuple) to use */
110     2 tuple_attr_index fixed bin,                           /* index of attribute to extract */
111     2 s_ptr ptr,                                            /* to source (tuple.data if var., ksl_ptr if key */
112     2 t_ptr ptr,                                            /* target, (encoded key value if encode) tuple ptr if expr */
113     2 sbit_len fixed bin (35),                              /* bit length (bit offset if var.) thd type if thd */
114     2 tbit_len fixed bin (35),                              /* target length */
115     2 s_desc bit (36),                                      /* descriptor for source */
116     2 t_desc bit (36),                                      /* descriptor for target */
117     2 encd_desc bit (36),                                   /* descriptor for encd attr */
118     2 fwd_thd ptr;                                          /* to next move info */
119 
120 dcl  mi_ptr ptr;
121 dcl  mi_nitems_init fixed bin;
122 
123 
124 /* the select info structure is used to hold info about
125    where to put a tuple that satisfies all conditions,
126    and to point to a list of comparisons to be made against
127    the tuple, before it is considered acceptable */
128 
129 dcl 1 select_info aligned based (seli_ptr),                 /* info for select op. */
130     2 tuple_info_index fixed bin,                           /* to output tuple */
131     2 tid_ptr ptr,                                          /* to place to store tuple id */
132     2 relation_search_specification_ptr ptr,                /* Search spec for relation manager gets */
133     2 cvla_ptr ptr;                                         /* pointer to cvl_array */
134 
135 dcl  seli_ptr ptr;
136 
137 /* END mrds_search_ops.incl.pl1 */
138