File architecture overview: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
No edit summary
Line 1: Line 1:
== Summary ==
== Summary ==


Model 204 files provide a highly flexible environment for handling large or small amounts of data. The system supports all types of data structures: flat structures, relations, hierarchies, and networks.
<p>Model 204 files provide a highly flexible environment for handling large or small amounts of data. The system supports all types of data structures: flat structures, relations, hierarchies, and networks.</p>


Model 204 uses inverted file retrieval techniques. These techniques facilitate rapid retrieval of data without requiring expensive scanning of the database itself.


Data within a Model 204 file are kept in an arbitrary collection of [[Record (File Architecture)|Records]].
<p>Model 204 uses inverted file retrieval techniques. These techniques facilitate rapid retrieval of data without requiring expensive scanning of the database itself.</p>


Records in a file normally are related to each other, although they need not be. Records within a given file may have the same format (same collection of field names) or any number of different formats (containing any mixture of the fields defined to Table A, nelow). A file can contain as many as 16.7 million records.
<p>Data within a Model 204 file are kept in an arbitrary collection of [[Record (File Architecture)|Records]].</p>


Files can be linked together logically according to field values within the files. Any number of files can be linked in this way. As many as 32,767 files can be accessed in one Model 204 job.  
<p>Records in a file normally are related to each other, although they need not be. Records within a given file may have the same format (same collection of field names) or any number of different formats (containing any mixture of the fields defined to Table A, nelow). A file can contain as many as 16.7 million records.</p>


Model 204 files consist of one or more data sets. Each data is formatted into fixed-length physical records called [[page (File Architecture)|page]]s, and all pages are the same size: 6184 bytes.  
<p>Files can be linked together logically according to field values within the files. Any number of files can be linked in this way. As many as 32,767 files can be accessed in one Model 204 job.</p>


Internally, these pages are organized into tables: the [[File Control Table (File Architecture)|File Control Table]] (FCT); [[Table A (File Architecture)|Table A]]; [[Table B (File Architecture)|Table B]]; [[Table C (File Architecture)|Table C]]; [[Table D (File Architecture)|Table D]]; [[Table E (File Architecture)|Table E]]; and [[Table X (File Architecture)|Table X]] with any pages in the file, not allocated to one of these considered [[Free Space (File Architecture) | Free Space]].
<p>Model 204 files consist of one or more data sets. Each data is formatted into fixed-length physical records called [[page (File Architecture)|page]]s, and all pages are the same size: 6184 bytes.</p>
 
<p>Internally, these pages are organized into tables: the [[File Control Table (File Architecture)|File Control Table]] (FCT); [[Table A (File Architecture)|Table A]]; [[Table B (File Architecture)|Table B]]; [[Table C (File Architecture)|Table C]]; [[Table D (File Architecture)|Table D]]; [[Table E (File Architecture)|Table E]]; and [[Table X (File Architecture)|Table X]] with any pages in the file, not allocated to one of these considered Free Space (see  (File Architecture) | Free Space]]. See [[Managing File and Table Sizes]] for how this free space can be applied to the other tables.</p>




Line 27: Line 28:
=== File Control Table ===
=== File Control Table ===


The [[FCT (File Architecture)|File Control Table]] Contains file parameter settings, data set or file definition names of all data sets in the file, the status of the file, and other control information. The FCT is always 8 pages.
The [[File Control Table (File Architecture)|File Control Table (FCT)]] Contains file parameter settings, data set or file definition names of all data sets in the file, the status of the file, and other control information. The FCT is always 8 pages.




Line 36: Line 37:
A dictionary of the fieldgroup / field names and their attributes.
A dictionary of the fieldgroup / field names and their attributes.


Some attributes (notably '[[CODED field attribute|CODED]]') require lists of values to be maintained. These lists are stored either in the [[FEW-VALUED field attribute|FEW-VALUED]] or [[MANY-VALUED field attribute|MANY-VALUED]] structures.  
Some attributes (notably '[[#Field Design (File Management)#CODED and NON-CODED field attribute|CODED]]') require lists of values to be maintained. These lists are stored either in the [[#Field Design (File Management)#FEW-VALUED and MANY VALUED field attributes|FEW-VALUED or MANY-VALUED]] structures.  


Table A usually is small in relation to the rest of the file. The field name section in particular should be as small as possible to aid efficient access, especially if your site uses field name variables
Table A usually is small in relation to the rest of the file. The field name section in particular should be as small as possible to aid efficient access, especially if your site uses field name variables
Line 61: Line 62:
pairs in a record is in the tens of millions.
pairs in a record is in the tens of millions.


There is only a limited fixed format for a record (pre-allocated [[Field (File Architecture)|fields]]). Almost any number of fields
There is only a limited fixed format for a record ([[#Field Design (File Management)#Preallocated fields|preallocated fields]]). Almost any number of fields
can appear almost any number of times in almost any order.
can appear almost any number of times in almost any order.
Each record is automatically assigned a unique internal record
Each record is automatically assigned a unique internal record
Line 68: Line 69:


|-
|-
! scope="row"| [[Repeating Field Group (File Architecture|Repeating Field Group]] (RFG)
! scope="row"| [[Repeating Field Group (File Architecture)|Repeating Field Group]] (RFG)
| Available as of Model 204 V7R5.
| Available as of Model 204 V7R5.


A [[Repeating Field Group (File Architecture|Repeating Field Group]] (RFG) is, as the name implies, a set of fields which are retrieved and updated in a single operation.  
A [[Repeating Field Group (File Architecture)|Repeating Field Group]] (RFG) is, as the name implies, a set of fields which are retrieved and updated in a single operation.  


|-
|-
! scope="row"| [[Field (File Architecture)|Field]]
! scope="row"| Field
| Elementary data item.
| Elementary data item.


Line 95: Line 96:
==== Index Structures ====
==== Index Structures ====


The [[Indexing (File Architecture)|Indexing]] structures necessary for direct retrieval of
<p>The indexing structures necessary for direct retrieval of
records are contained in Tables C and D.  
records are contained in Tables C and D.</p>


There are two types of indexes, both of which utilize Table D [[Bitmap Pages (File Architecture)|Bitmap Pages]] and [[List Pages (File Architecture)|List Pages]]:
<p>There are two types of indexes, both of which utilize Table D [[#Table D (File Architecture)#List and Bit Map Pages|List and Bitmap Pages]]:</p>


::{| class="wikitable";style="width="80%
::{| class="wikitable";style="width="80%
Line 106: Line 107:
|-
|-
! scope="row"| Ordered Index
! scope="row"| Ordered Index
| Is composed of the Ordered Index B-tree, contained in Table D, for [[ORDERED field attribute|ORDERED]] fields along with either [[IMMED field attribute|IMMED]]iate pointers to the record in Table B,<br/> or to a secondary index (of list or bitmap pages) located in Table D.
| Is composed of the Ordered Index B-tree, contained in Table D, for [[#Field Design (File Management)#ORDERED and NON-ORDERED attribute|ORDERED]] fields along with either a number of IMMEDiate pointers to the record in Table B,<br/> or to a secondary index (of list or bitmap pages) located in Table D.


|-
|-
! scope="row"| Hashed Index
! scope="row"| Hashed Index
| Is composed of Table C, which indexes [[KEY field attribute|KEY]] and [[NUMERIC RANGE field attribute|NUMERIC RANGE]] fields, along with either a single<br/> direct pointer (per segment) to a base record in Table B or or a secondary index (of list or bitmap pages) located in Table D.
| Is composed of Table C, which indexes [[#Field Design (File Management)#KEY and NON-KEY attribute|KEY]] and [[#Field Design (File Management)#NUMERIC RANGE and NON-RANGE attribute|NUMERIC RANGE]] values in fields, along with either a single<br/> direct pointer (per segment) to a base record in Table B or or a secondary index (of list or bitmap pages) located in Table D.


|}  
|}  
Line 116: Line 117:
==== Index Tables ====
==== Index Tables ====


[[Table C (File Architecture)|Table C]] contains a series of entries every [[Field Value Pair (File Architecture)|Field Value Pair]] combination that occurs in the file for fields defined as [[KEY field attribute|KEY]]. There are also many series of entries for every [[Field Value Pair (File Architecture)|Field Value Pair]] that occurs for fields that have the [[NUMERIC RANGE field attribute|NUMERIC RANGE]] attribute.  
[[Table C (File Architecture)|Table C]] contains a series of entries for every field / value combination (whether a [[Field Value Pairs (File Architecture)|Field Value Pair]] or preallocated field) that occurs in the file for fields defined as [[#Field Design (File Management)#KEY and NON-KEY attribute|KEY]]. There are also many series of entries for every Field Value Pair that occurs for fields that have the [[#Field Design (File Management)#NUMERIC RANGE and NON-RANGE attribute|NUMERIC RANGE]] attribute.  


The series consists of an entry cell, chained to cells with an entry for any segment that contains one or more occurrences of the [[Field Value Pair (File Architecture)|Field Value Pair]]. If a [[Field Value Pair (File Architecture)|Field Value Pair]] is
The series consists of an entry cell, chained to cells with an entry for any segment that contains one or more occurrences of the [[Field Value Pair (File Architecture)|Field Value Pair]]. If a [[Field Value Pairs (File Architecture)|Field Value Pair]] is unique within a segment, the Table C cell contains the IRN of the Table B record in which the field occurs. If the field name = value pair is not unique in the segment, the Table C cell contains a pointer to a bitmap or list page in Table D (as described above).
unique within a segment, the Table C cell contains the IRN of the Table B record in which the field occurs. If the field name = value pair is not unique in the segment, the Table C cell contains a pointer to a bitmap or list page in Table D (as described above).




[[Table D (File Architecture)|Table D]] contains: the Ordered Index B-tree node pages, which contain the values and record accessing information for all [[ORDERED field attribute|ORDERED]] fields; as well as the bitmap and list pages described above.  
[[Table D (File Architecture)|Table D]] contains: the Ordered Index B-tree node pages, which contain the values and record accessing information for all [[#Field Design (File Management)#ORDERED and NON-ORDERED attribute|ORDERED]] fields; as well as the bitmap and list pages described above.  


This includes the [[Existence Bit Map (File Architecture)|Existence Bit Map]]
This includes the [[#Table D (File Architecture)#The Existence Bit Map|Existence Bit Map]]


Table D can be expanded with the [[INCREASE command]].
Table D can be expanded with the [[INCREASE command]].

Revision as of 01:54, 30 April 2013

Summary

Model 204 files provide a highly flexible environment for handling large or small amounts of data. The system supports all types of data structures: flat structures, relations, hierarchies, and networks.


Model 204 uses inverted file retrieval techniques. These techniques facilitate rapid retrieval of data without requiring expensive scanning of the database itself.

Data within a Model 204 file are kept in an arbitrary collection of Records.

Records in a file normally are related to each other, although they need not be. Records within a given file may have the same format (same collection of field names) or any number of different formats (containing any mixture of the fields defined to Table A, nelow). A file can contain as many as 16.7 million records.

Files can be linked together logically according to field values within the files. Any number of files can be linked in this way. As many as 32,767 files can be accessed in one Model 204 job.

Model 204 files consist of one or more data sets. Each data is formatted into fixed-length physical records called pages, and all pages are the same size: 6184 bytes.

Internally, these pages are organized into tables: the File Control Table (FCT); Table A; Table B; Table C; Table D; Table E; and Table X with any pages in the file, not allocated to one of these considered Free Space (see (File Architecture) | Free Space]]. See Managing File and Table Sizes for how this free space can be applied to the other tables.


The components of a Model 204 File



File Control Table

The File Control Table (FCT) Contains file parameter settings, data set or file definition names of all data sets in the file, the status of the file, and other control information. The FCT is always 8 pages.


The Internal File Directory

Table A contains three structures:

A dictionary of the fieldgroup / field names and their attributes.

Some attributes (notably 'CODED') require lists of values to be maintained. These lists are stored either in the FEW-VALUED or MANY-VALUED structures.

Table A usually is small in relation to the rest of the file. The field name section in particular should be as small as possible to aid efficient access, especially if your site uses field name variables


Data

Data Structures

All data held in a Model204 file are held in Records.

Model 204 records are best thought of as very loosely defined containers, with almost no fixed structure


Record Collection of fields (either individually or in Repeating Field Groups (RFGs).

Each record is variable in length and need contain only the fields that pertain to it. The limit of the number of field value pairs in a record is in the tens of millions.

There is only a limited fixed format for a record (preallocated fields). Almost any number of fields can appear almost any number of times in almost any order. Each record is automatically assigned a unique internal record number that is used by the system to build index entries for the record.

Repeating Field Group (RFG) Available as of Model 204 V7R5.

A Repeating Field Group (RFG) is, as the name implies, a set of fields which are retrieved and updated in a single operation.

Field Elementary data item.

Fields are defined with attributes that control storage formats and indexing options. Up to 4000 (32000 as of Model 204 V7R5) different field names can be defined in a single Model 204 file.

Data Tables

Table B contains (at least) the base data of all the records in the file. These base records contain pointers to any extensions which exist (whether they are elsewhere in Table B or in Table X).

Table X when enabled, holds only any and all extension records. Table B is then used to store only base records, thus, maximizing the possible number of records can be stored regardless of the number of extension records.

Table E (when enabled) contains Large Object data for the file. The pointer to the starting point of the LOB is contained in Table B or X.


Indexing

Index Structures

The indexing structures necessary for direct retrieval of records are contained in Tables C and D.

There are two types of indexes, both of which utilize Table D List and Bitmap Pages:

Index Type Description
Ordered Index Is composed of the Ordered Index B-tree, contained in Table D, for ORDERED fields along with either a number of IMMEDiate pointers to the record in Table B,
or to a secondary index (of list or bitmap pages) located in Table D.
Hashed Index Is composed of Table C, which indexes KEY and NUMERIC RANGE values in fields, along with either a single
direct pointer (per segment) to a base record in Table B or or a secondary index (of list or bitmap pages) located in Table D.

Index Tables

Table C contains a series of entries for every field / value combination (whether a Field Value Pair or preallocated field) that occurs in the file for fields defined as KEY. There are also many series of entries for every Field Value Pair that occurs for fields that have the NUMERIC RANGE attribute.

The series consists of an entry cell, chained to cells with an entry for any segment that contains one or more occurrences of the Field Value Pair. If a Field Value Pair is unique within a segment, the Table C cell contains the IRN of the Table B record in which the field occurs. If the field name = value pair is not unique in the segment, the Table C cell contains a pointer to a bitmap or list page in Table D (as described above).


Table D contains: the Ordered Index B-tree node pages, which contain the values and record accessing information for all ORDERED fields; as well as the bitmap and list pages described above.

This includes the Existence Bit Map

Table D can be expanded with the INCREASE command.


Procedures and Miscellaneous Structures

Table D also contains a few other structures:

It contains procedure (code)and structures used to mange them: a procedure dictionary (used to store procedure names and aliases); and an Access Control Table (used to map user and procedure classes).

It contains a reserved area (DPGSRES) that primarily provides additional space for the transaction back out facility.

A map of the Preallocated Fields (used whenever a new records is stored) is also contained in Table D. This map can be seen by the DISPLAY RECORD command.