1 /* BEGIN mdbm_rm_rel_info.incl.pl1 -- jaw, 11/16/78 */
  2 
  3 /* WARNING
  4           If the rm_rel_info structure is changed then the mrds_data_
  5           item saved_res_version MUST be incremented to invalidate all
  6           existing saved resultants
  7 */
  8 
  9 /* HISTORY:
 10 
 11    Modified by Jim Gray - - May 1980, to  include  model  number  of
 12    attributes,   and   varying  attributes,  so  that  partial  view
 13    submodels will have the  info  needed  to  properly  set  up  the
 14    varying length array headers in the tuple structure.
 15 
 16    Modified  by  Jim  Gray  -  -  80-11-06,  to  rename   r_perm   =
 17    status_perm,     s_perm    =    append_tuple_perm,    d_perm    =
 18    delete_tuple_perm, and make m_perm = unused_perm.
 19 
 20    81-01-23 Jim Gray : added bit to indicate whether the last  model
 21    view attribute was varying character or bit, since a partial view
 22    submodel will not have this information in the resultant, and  it
 23    is  needed for determining the new tuple length in mus_mod_ubtup,
 24    since with exact length storage  of  varying  length  attributes,
 25    each  tuple  can  be  a  different  length,  which is can only be
 26    determined by examining the tuple itself.
 27 
 28    81-01-29 Jim Gray : added curent  tuple  count,  to  provide  for
 29    interface  to  allow  temp  rel  population  to  be known, and to
 30    provide a more efficient means of finding an approx. current perm
 31    relation population.
 32 
 33    81-05-28 Jim Gray  :  removed  structure  elements  referring  to
 34    blocked  files, foreign keys, and ids procedures. Also set number
 35    of files per rel to a constant of 1.
 36 
 37    81-05-28 Jim Gray : combined data  from  rm_file_info  into  this
 38    structure so that only one structure per relation is needed.
 39 
 40    81-07-02 Jim Gray : added total_key and dup_key vfile  statistics
 41    counts.   Also  added  number  of  operations  count  since  last
 42    statistics update, and a time  since  the  statistics  were  last
 43    updated.
 44 
 45    81-07-06 Jim Gray :  added  a  per  selection  expression  update
 46    identifier so that small relations could be updated on a per S.E.
 47    basis
 48 
 49    82-04-21 R. Lackey : Added number_selected (ri_niocbs_init refer (rm_rel_info.niocbs)) fixed bin (35)
 50    to end of structure   TR 12205 (Suggestion).
 51 
 52    82-08-19 D. Woodka :  Removed  rm_rel_info.max_data_len  field for
 53    the DMS conversion.
 54 
 55    82-08-30 Davids: added the opening_id element and removed the iocb
 56    array and the niocb element for DMS conversion. Also removed the
 57    number_selected array (and ri_niocbs_init) since subsets are not
 58    going to be used.
 59 
 60    82-09-20 Mike Kubicar : changed rm_rel_info.rel_id to bit (36) aligned
 61    so that it can be used with relation manager.  Also added
 62    rm_rel_info.primary_key_index_id for relation manager.
 63 
 64    82-09-22 Mike Kubicar : Removed the, now useless, fields var_attr_ptrs,
 65    nvar_atts, model_nvar_atts.
 66 
 67    82-09-24 Davids: Removed current_key_count and current_dup_key_count
 68    since the duplicate key count for each secondary index is now being
 69    kept in the attr_info structure and key_count was only needed to
 70    help in calculating the average selectivity of each index which
 71    can now be gotten directly from each index's dup key count. Also
 72    removed the file_id element since it is no longer needed for
 73    anything.
 74 
 75    82-09-27 Mike Kubicar : removed file_id_len for the same reason file_id
 76    was removed.
 77 
 78    82-11-05 Mike Kubicar : added a pointer to an id_list structure to be
 79    used when retrieving tuples from this relation.
 80 
 81    83-04-06 Davids: Added the scope_flags_ptr which points to the scope_flags structure
 82    for the relation. Note that this structure is part of the resultant NOT
 83    part of the db.control structure. The scopes are duplicated in the resultant
 84    to reduce contention for the db.control structure. Note also that the pointer
 85    will always point to a scope_flags structure even if no scopes have been
 86    set on the relation, the structure is allocated when the db is opened.
 87 */
 88 
 89 
 90 /* DESCRIPTION:
 91 
 92    This structure is allocated in the area part of the structure  in
 93    mdbm_rm_db_info.incl.pl1  as  part of the resultant model created
 94    at open  time  for  a  database.  There  will  be  one  of  these
 95    rm_rel_info   structures  for  each  relation  appearing  in  the
 96    database view (there may be less than the total in  the  database
 97    for  a  submodel  openings).  There  will  also  be  one for each
 98    temporary relation currently defined for that opening.
 99 
100    The structure in mdbm_rm_rel_array.incl.pl1 contains pointers  to
101    all  rm_rel_info  structures  allocated. It is used for searching
102    for the appropriate  structure.  This  array  is  pointed  to  by
103    rm_db_info. There are two arrays, one for perm rels, one for temp
104    rels.
105 
106    The      rm_rel_info      structure      points      to       the
107    mdbm_rm_attr_info.incl.pl1  structures,  one  for  each attribute
108    appearing in this view of the relation. Each  of  these  in  turn
109    point  to a mdbm_rm_domain_info.incl.pl1 structure for the domain
110    info for each attr.
111 
112    Most of the other information here deals with  specifics  of  the
113    relation's  logical  definition,  such as key and secondary index
114    attribute inidicators, security permissions, and  tuple  physical
115    construction details.
116 
117 */
118 
119      dcl     1 rm_rel_info          aligned based (rmri_ptr), /* relation information */
120                2 name               char (32),              /* from submodel */
121                2 model_name         char (30),              /* from model */
122                2 rel_id             bit (36) aligned,       /* unique id. */
123                2 retrieve           bit (1) unal,           /* operations allowed by this view */
124                2 modify             bit (1) unal,
125                2 delete             bit (1) unal,
126                2 store              bit (1) unal,
127                2 total_key          bit (1) unal,           /* on if view includes full primary key */
128                2 indexed            bit (1) unal,           /* on if exists sec. index */
129                2 mdbm_secured       bit (1) unal,           /* on if mdbm must check security */
130                2 status_perm        bit (1) unal,           /* if user has status. perm. */
131                2 append_tuple_perm  bit (1) unal,           /* if user has store perm. */
132                2 delete_tuple_perm  bit (1) unal,           /* if user has del. perm. */
133                2 unused_perm        bit (1) unal,           /* for future use. */
134                2 last_model_attr_char_var bit (1) unal,     /* on => last model varying attr is char */
135                2 reserved           bit (24) unal,          /* for future use */
136                2 num_attr           fixed bin,              /* total no. of attr. in rel. */
137                2 model_num_attr     fixed bin,              /* total attrs in model relation */
138                2 nkey_attr          fixed bin,              /* no. of key attr. */
139                2 model_nkey_attr    fixed bin,              /* total number of keys in model */
140                2 primary_key_index_id bit (36) aligned,     /* Index id of relation's primary key */
141                2 nsec_inds          fixed bin,              /* no. sec. indexes */
142                2 max_key_len        fixed bin (35),         /* max length (chars) of primary key */
143                2 current_tuple_population fixed bin (35),   /* last known total  tuple count for this relation */
144                2 last_statistics_update_count fixed bin,    /* number of operations's, since this rels stats were updated */
145                2 last_statistics_update_time fixed bin (71),/* last time this rels stats were updated */
146                2 last_statistics_update_s_e_ref_num fixed bin (35), /* last select expr ID that updated this rels stats */
147                2 ready_mode         fixed bin,              /* 1 => r, 2 => mr, 3 => u, 4 => l, 5 => sr, 6 => su */
148                2 file_type          fixed bin,              /* 1 => unblocked, 2 => blocked, 3 => temporary */
149                2 tuple_id_len       fixed bin,              /* no. bits in local tuple id */
150                2 opening_id         bit (36) aligned,       /* relation manager opening is */
151                2 key_attr_ptrs      (nkey_attr_init refer (rm_rel_info.nkey_attr)) ptr, /* ptrs to key attr. */
152                2 attr_ptrs          (natts_init refer (rm_rel_info.num_attr)) ptr, /* ptrs to all attr. */
153                2 id_list_ptr        ptr,                    /* Id list for retrieves from the relation */
154                2 scope_flags_ptr    ptr;                    /* pointer to the scope_flags structure for the rel */
155 
156      dcl     rmri_ptr               ptr;
157      dcl     (nkey_attr_init,
158              natts_init,
159              nvar_atts_init)        fixed bin;
160 
161 /* END mdbm_rm_rel_info.incl.pl1 */
162 
163