This program is part of the procedure necessary to stabilize a qddb database. Given a stabilized Database file in a directory RelationDirectory,qindex builds files called Index,HashTable,KeyIndex, and NumericIndex that are used as a set of hash buckets for keys in the database. HashTable is a list of (byte offset, byte length) tuples that describe the location of a key's hash bucket in the file Index.KeyIndexandNumericIndexareorderedfilesofalphanumericand numeric keys respectively, mostly used for range and regular expression searching. The -v option selects verbose output; qindex is silent otherwise.

Index and HashTable allow a program to find all entries that contain a particular key in only two read system calls. Most programs will keep the entire HashTable file in memory, so only 1 read is necessary to find the list of entries. Cached hashing is available and requires an extra read for each hash table entry needed (although entries are cached afterward).

Note that the Database file must be stabilized with qstab(1) and qkeys(1) respectively before completing the stabilization process with qindex(1). The usual sequence of stabilization is qstab(1), qkeys(1), qindex(1).

qindex expects the Database file to contain tuples separated by a blank (newline terminated) line. Programmers wishing to build new interfaces, either front or back ends to qddb, must remember this restriction.