|
This section provides general information about the File Information Editor with which you can create new files based on file and key specifications you construct. Because this Editor allows you to load information based on an existing file, it is also useful for viewing file and key specifications on existing data files. You can also create a new file based on the file and key specifications of an existing file (similar to the CLONE command for BUTIL, the command-line Maintenance utility).
Open the File Information Editor by clicking Options 4 Show Information Editor.

At the top of the Editor, the following buttons appear:
The Data File Info area, also at the top of the File Information Editor, contains the following controls:
|
Owner Name
|
Provides a text box you can use to specify the owner name, if applicable, for an existing file.
|
|
Version
|
Earliest version of the database engine that can read all the attributes of the file. For example, if you created a file using the 9.5 database engine but did not use any attributes specific to 0.5, the Maintenance utility displays 9.0 as the version number. See File Version Notes for additional information about file format versions.
|
|
Total Records
|
Total number of records in the file.
|
The File Specification area is in the middle of the File Information Editor. Table 13-2 describes the controls in this box.
|
Control
|
Description
|
Range
|
Default
|
|---|---|---|---|
|
Record Length
|
Specifies the logical data record length (in bytes) of the fixed-length records in a file.
For information about record length and overhead, see "Record Length" in Pervasive PSQL Programmer's Guide, which is part of the Pervasive PSQL software development kit (SDK).
|
Minimum is 4 bytes. Maximum is variable. If the record length specified exceeds the page size minus overhead, the database engine automatically tries the next available page size for the file format. If the record length exceeds the maximum page size minus overhead, the engine turns on record compression.
|
100
|
|
Page Size
|
Specifies the physical page size (in bytes) for the file.
|
512 - 4096 for file versions prior to 9.0 (a multiple of 512 bytes up to 4096)
512, 1024, 1536, 2048, 2560, 3072, 3584, 4096, or 8192 for file version 9.0.
1024, 2048, 4096, 8192, or 16384 for file versions 9.5 and newer.
|
4,096
|
|
# Keys
|
Indicates the number of distinct keys (as opposed to key segments) currently defined in the Editor. Reflects the number of keys in the Key list.
|
0 - 119
|
0
|
|
# Segments
|
Indicates the number of key segments currently defined in the Editor. Reflects the number of segments in the Segment list.
|
0 - 119 for file versions prior to 9.5.
0 - 420 for file versions 9.5 and newer.
Note that, for all file versions, the maximum number of segments for the relational interface is 119.
|
0
|
|
Available Linked Keys
|
Specifies how many 8-byte place holders you want to reserve for future linked-duplicatable keys. If you are loading information based on an existing data file, this value reflects the number of place holders currently available in that file. (The number of originally reserved place holders is not stored in the file.)
|
0 - 119
|
3
|
|
Key-Only
|
Indicates whether the file is key-only. Not applicable if you turn Record Compression on, if you turn Variable Records on, or if you define more than one key for the file.
|
On or Off
|
Off
|
|
Balanced Indexing
|
Specifies that the file uses the balanced indexing method of managing key pages.
|
On or Off
|
Off
|
|
Pre-allocation
|
Specifies that the file uses preallocated pages.
|
On or Off
|
Off
|
|
# Pages
|
Specifies the number of pages you want preallocated when you create the file. Applicable only if Pre-allocation is turned on. If you are loading information based on an existing data file, this value reflects the number of unused, preallocated pages left in that file. (The number of originally preallocated pages is not stored in the file.)
|
1 - 65,535
|
0
|
|
Record Compression
|
Specifies that the file uses record compression. Not applicable for key-only files or files that use blank truncation. See also Record and Page Compression .
|
On or Off
|
Off
|
|
Page Compression
|
Specifies that the file uses page compression. See also Record and Page Compression .
|
On or Off
|
Off
|
|
Variable Records
|
Specifies that the file can contain variable-length records.
|
On or Off
|
Off
|
|
Blank Truncation
|
Specifies whether the file uses blank truncation on variable records to conserve disk space. Applicable only if Variable Records is turned on.
|
On or Off
|
Off
|
|
Include VATs
|
Specifies whether the file supports Variable-tail Allocation Tables for faster access to data in very long records. Applicable only if Variable Records is turned on.
|
On or Off
|
Off
|
|
% Free Space
|
Specifies the amount of unused space a file's variable pages must have available before the database engine creates a new variable page. Applicable only if Record Compression or Variable Records are turned on.
|
5, 10, 20, or 30
|
5
|
At the bottom left in the dialog box is the Key group box. Table 13-3 describes the controls in this area. These controls are specific to the key highlighted in the Key list, not just to the current key segment. When you change the setting for one of these controls, the change affects all segments of the specified key.
At the bottom middle of the dialog box, the Key list shows the key numbers defined in a file. (For 6.x and later files, these key numbers do not have to be consecutive; they can have gaps between them.) The Maintenance utility displays the highlighted key's specifications in the Key box at the bottom left of the dialog box.
Also at the bottom middle of the dialog box, the Segment list shows the key segment numbers defined for the key highlighted in the Key list. The Maintenance utility displays the highlighted segment's specifications in the Segment box at the bottom right of the dialog box.
In addition, the following buttons appear under the Key and Segment lists:
Because these buttons control key specifications for a file you want to create, you cannot use them to operate on keys in an existing file. If you want to create or drop an index on an existing file, refer to Index Tasks .
At the bottom right in the dialog box is the Key Segment group box. Table 13-4 describes the controls in this area. These controls are specific to the segment highlighted in the Segment list),
Multiple records may carry the same duplicated value for index keys. The two methods to keep track of the records with duplicate key values are called linked duplicates and repeating duplicates.
The linked duplicates method uses a chain technique in which each record in the group connects to its neighbors by means of pointers. Each entry on an index page contains a pair of record pointers that indicate the first and last links in the chain of records that duplicate that key's value. This makes each key page entry 4 bytes longer than a repeating duplicates index. In addition, each record on the data page requires an extra 8 bytes of overhead for each linked duplicates index. These 8 bytes consist of two record pointers that point to the next and previous records in the chain.
The first record pointer holds the address of the first, or oldest, record stored. The second pointer holds the address of the most recent, or newest record. After the first record is written but before any others are added, both pointers on the key page entry hold the first record's address. Subsequent records cause the second pointer to be changed to point to each record as it is added. This permits the record pointer for the last record to be used as the previous-record link of the chain built in the data page when the record is added, and also to be used to locate that previous record.
With the repeating duplicates method, each duplicate key value is stored on both the index page and within the record on the data page. Each key value has only one record pointer instead of two. This method requires no chaining within the data records and saves the 8 bytes of overhead per index within each record. Since the key value is repeated for each duplicate record, the indexes affected increase in size.
The linked duplicates and repeating duplicates methods can be compared based on the following criteria:
A linked duplicates index retrieves duplicates in the order in which they were inserted. A repeating duplicates index retrieves duplicates in the order in which they are located within the file. Since location with a file cannot be controlled, the ordering must be considered as random.
A linked duplicates index requires 12 more bytes for the first occurrence of each duplicate key value. That includes 8 extra bytes on each record and 4 extra bytes for the key page entry. But each duplicate record requires no additional space in the key page, and adds only 8 bytes per record. Therefore, as the number of duplicates per key value increases, and as the size of the key value increases, linked duplicate indexes can save significant storage space used by key pages. However, storage space can increase if your file contains very few records with duplicate keys, the key length is very short, or both.
The following figure exemplifies the amount of storage space saved using linked duplicate indexes. Note that linked duplicate indexes take more space if duplicate records per key value are few. As the number of duplicate records per key value increases, however, linked duplicate indexes require less pages, providing significant space savings.

|
Legend:
|
= linked duplicates
|
= repeating duplicates
|
|
Top two lines represent a key length of 100
Middle two lines represent a key length of 50 Bottom two lines represent a key length of 4 |
||
Faster performance results when fewer pages are involved in an index search because fewer pages must be read from disk. The linked duplicates method generally uses less physical storage space and therefore provides faster performance. The repeating duplicates method provides a performance advantage if only a small number of keys have duplicates.
The database engine provides page-level concurrency when several concurrent transactions are active on the same file at the same time. This applies to most changes to key pages and for all changes to data pages. The concurrency means that the same page can contain pending changes from separate transactions at the same time, and the transactions can be committed in any order. Repeating duplicate indexes take the most advantage of this concurrency.
Linked duplicate indexes add another limitation on concurrency that does not exist with repeating duplicates. When a new duplicate is created, the new record is linked to another record at the end of the list. This record linking causes two records to be locked instead of one. Since all duplicates are added to the end of the chain of linked records, only one duplicate can be inserted at a time.
Such a record lock conflict usually causes other clients to wait until the first transaction is committed. In a concurrent environment, if all new records use the same duplicate value, then concurrency can effectively be reduced to one transaction at a time. And if transactions are large or long lasting, this serialization can affect performance tremendously.
Performance is typically better if you use repeating duplicate indexes for databases that are updated in a concurrent environment. Therefore, unless you have a compelling reason to use the linked duplicates method, you should use repeating duplicate indexes for databases that are updated in a concurrent environment.
You perform the following tasks with the File Information Editor:
When you load information from an existing file, you are not editing the existing file. Instead, you are loading a copy of the information about that file. Generally, you want to load a data file before performing other tasks with the File Information Editor, but this is not mandatory.
To load information from an existing data file into the File Information Editor

.mkd extension.)The Maintenance utility first attempts to open the specified file as a data file. If the file requires an owner name, the utility prompts you for one. (Because owner names are optional, the file you open may not require an owner name.) If the specified file is not a data file, the utility then attempts to open the file as a description file.
You can create a new file based on the current information in the File Information Editor or on new information you provide.
To create a new file based on the current information in the File Information Editor

|
Control
|
Description
|
Default
|
|---|---|---|
|
File Name
|
Specifies a name and path for the file. By default, data files have the.mkd extension.
|
N/A
|
|
File Type
|
Specifies the type of file to create. If you are creating a description file, you can use the Index Only option, which creates a description file you can use with the BUTIL utility to add an index to an existing data file. (For more information, refer to Creating Indexes .)
|
MicroKernel-compatible
|
|
System Data
|
Determines whether the utility includes system data in the file. If you choose Use Engine Setting, the utility uses the setting for the System Data configuration option described . If you choose No System Data, the utility does not create system data, regardless of the engine configuration. If you choose Force System Data, the utility creates system data, regardless of the engine configuration.
This is applicable only if the file type is MicroKernel-compatible. |
Use Engine Setting
|
The comments are written to the top of the description file when you create the description file. For example, the comment, "This is my file," appears at the top of the description files as /* This is my file */. If you add additional comments after creating the description file, you need to create the file again to include the additional comments.
To add comments to a description file
You can compact a Btrieve data file to remove unused space in it, which typically decreases the file size. You can also perform this procedure using the command-line Maintenance utility (page 13-62).
To compact a Btrieve file
You can now compare the size of the original file to the clone file to verify the reduction in size.
You can use an alternate collating sequence (ACS) to sort string keys (types STRING, LSTRING, and ZSTRING) differently from the standard ASCII collating sequence. By using one or more ACSs, you can sort keys as follows:
Files can have a different ACS for each key in the file, but only one ACS per key. Therefore, if the key is segmented, each segment must use either the key's specified ACS or no ACS at all. For a file in which a key has an ACS designated for some segments but not for others, Btrieve sorts only the segments that specify the ACS.
The ISR tables are provided with Pervasive PSQL and are based on ISO-standard locale tables. ISR tables are stored in the COLLATE.CFG file, which is a Pervasive PSQL system file. This means that multiple data files can share a single ISR.
To specify a key's alternate collating sequence
The Maintenance utility displays the Specify ACS Information dialog box.

To specify an ACS that sorts string values using an ISO-defined, language-specific collating sequence, you must specify an ISR table name. The Table Name field is limited to 16 characters. For more information on ISRs, refer to the Pervasive PSQL Programmer's Guide, available with the Pervasive PSQL Software Developer's Kit (SDK).
|
Chapter contents
Prev topic: Btrieve Interactive Maintenance Utility
|