bdfd1m0m | Database Administration |
Each LREC in the flight file contains the fields shown in Table 29. Table 29 also shows the number of bytes in each
field.
Table 29. LREC Fields for the Flight File
Field | No. of bytes |
---|---|
size | 2 |
key | 1 |
date | 2 |
flight number | 7 |
time | 2 |
start | 3 |
destination | 3 |
aircraft type | 4 |
availability | 6 |
pointer to seat file | 5 |
Total | 35 |
The pointer to the aircraft table has been removed from this file (see Distributing the Aircraft LRECs). Each LREC in the flight file now contains 35 bytes.
As shown previously in the Data Requirements table (Table 20), the database must be able to accommodate 100 flights each day. You can calculate the amount of data as follows:
no. of flights each day x LREC size = amount of data
The calculation is:
100 x 35 = 3500 bytes
Therefore, use 4-K blocks to store the LRECs. Because the database must hold records for 366 days, you need 366 blocks to store the flight information.
The structure of the flight file is simple; there is one subfile for each day's flights. One fast method of accessing the subfiles is to assign a relative number to each day of the year.
The application translates the day directly into an ordinal matching a subfile. For example, 1 Jan=1st, 2 Jan=2nd . . . . 31 Dec=366th. The ordinal serves as a value for the string passed with the ALG parameter. You can use algorithm #TPFDB05 to retrieve the ordinal directly.
For a more detailed explanation, see Figure 51.
Although the size of the flight file is fixed at the moment, you may need to expand it in the future. Because of this, consider how a data overflow might be accommodated.
There is room for some expansion in the blocks already assigned, and 4-K blocks are likely to be large enough to accommodate an increased number of flights. If the number of flights increase greatly, increase the size of the overflow blocks by changing the value of the DBDEF ARS parameter and then using the ZUDFM OAP command. An increase in block size would mean a reduction in I/O processing, therefore maintaining good performance levels despite the increase in data.
Because the flight file is an index file, its LRECs must contain
pointers. The structure of the flight file LRECs is as follows: