URL: http://www.firstbasesoftware.com/man/man5/idicti.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]


NAME

idicti - FirstBase index dictionary files

SYNOPSIS

Layout of FirstBase index dictionary files

DESCRIPTION

An index dictionary file is a text file used to create FirstBase indexes. This file not only describes the selection criteria that are used to select records from the database, but it also lists the actual fields that will be stored in the index, i.e. the field values that will be written to the index and sorted.

Formally, this file is edited using the dbdind(1) tool, and used by dbigen(1) to actually create the index.

This manual page describes the layout of index dictionary files so that creation of theses index files can be accomplished using a shell script or C program. Dbigen(1) will still need to be used to generate the actual index.

An index dictionary is a line oriented text file. Each line contains either a single character symbol marker, or a field name with selection values.

The symbols of the index dictionary are used to delimit 'And Trees' and 'Or Trees', with another symbol used to denote a 'Simple And' connection. Here is a list of the symbols and their meaning:

$
begin a Tree -- assume an And Tree

#
begin (end) an Or Tree

&
connect the previous and next lines with a simple and. Appears only within an Or Tree.

%
End of selection criteria or Btree marker. First occurrence indicates that the next line contains Index Value field names. If the line after the field names line is also a % marker, then the tree generated will be a FirstBase Btree+ structure.

AND TREES

An And Tree is the most simple subtree of the index dictionary. It consists of a single $ symbol, followed on the next line by a Field Name line. Field Name lines are discussed below.

OR TREES

An Or Tree is a bit more complex. It too begins with a $ symbol, but it is followed by a # symbol. This 'begin Or Tree' symbol is followed by any number of Field Name lines. The end of the 'Or Tree' is denoted by the # symbol again. All Field Name lines in between the two # markers will be connected with a logical OR during the generation of the index.

A special Simple And symbol, &, can appear in the middle of an Or Tree. This symbol will cause the upper and lower sub-sections of the 'Or Tree' to be connected with a logical And. In other words, use of the 'Simple And' implements a different precedence. For example, the 'Simple And' symbol allows selection logic of the form '(A OR B) AND (C OR D)'.

FIELD NAME LINES

A Field Name Line consists of a single field name followed by two values. These values are referred to as Val1 and Val2. Note that underscores should be used in place of blanks within all fields that have embedded blanks in their names.

The two values on a Field Name line represent the endpoints of the range of accepted values for that Field. For example, a Field Name line of 'Field1 101 202' will match a record when the value of Field1 is greater than or equal to 101 and less than or equal to 202.

There are a few special Meta-Values that can also be used as Val1 and Val2. Val1 can have the meta-value $ALL or $NOT. If the value $ALL is used, Val2 is unused, and should be blank. If the value $NOT is used, a match only occurs if the contents of the field is not the value listed as Val2.

Val2 can be a meta-value also. $NONE will force an exact match using the Val1 value, while $PATTERN will cause Val1 to be used as a regular expression in attempting to match the contents of Field1 with Val1.

Alternately, Val1 and Val2 can be used to compare the Field Name value to another field value in each examined record. In this scenario, Val1 takes on one of the values $GT $LT, $GE, $LE, $EQ, or $NE. Val2 must then be a valid Field Name.

INDEX VALUES LINE

As mentioned above, the % symbol marks the end of all selection criteria. The next line, is the Index Values Line. This line lists all of the field names whose contents will be stored in the generated index. Again, all field names should be listed on a single line, separated by blanks.

BTREE MARKER

The last line of the index dictionary can be a % to indicate that this index will be a Btree index when generated. Btree indexes are automated using the autoindex(5) file.

EXAMPLES

The following are three examples of .idicti files. The first example will select all records that have the contents of Field1 between 101 and 202 inclusive, and create an index using these Field1 values.

The second example below will select all records that have the contents of Field1 between 101 and 202 inclusive, and the contents of Field2 either between abc and def, or between xyz and zzz. In pseudo code, this selection translates to (Field1 >= 101 && Field1 <= 202) && ((Field2 >= abc && Field2 <= def) || (Field2 >= xyz && Field2 <= zzz)). The created index will contain (and be sorted by) Field1, Field2 and Field3.

The third example will select all records where the value of Field1 is greater than the value of Field2. The resulting index will be sorted by Field2. Note that it will not be a Btree index, but will instead be a flat index.


____________ Example 1: ____________ $ Field1 101 202 % Field1 % ____________
Example 2: ____________ $ Field1 101 202 $ # Field2 abc def Field2 xyz zzz # % Field1 Field2 Field3 % ____________ Example 3: ____________ $ Field1 $GT Field2 % Field2 ____________

FILES

*.idx
FirstBase index. Actual index values and pointers to records.

*.idicti
FirstBase index dictionary, formally produced by dbdind(1).

*.idict
FirstBase index header information, produced by dbigen(1).

SEE ALSO

dbdind(1), dbigen(1), btree(4), index(4).


URL: http://www.firstbasesoftware.com/man/man5/idicti.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]