qindex - Build an Index file in the given RelationDirectory.
qindex [-v] RelationDirectory
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. KeyIndex and NumericIndex are ordered files of alphanumeric and 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 exits with a 0 status on success, 1 otherwise.
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.
A Guide to QDDB
Eric H. Herrin II and Raphael A. Finkel
Qddb User's Guide
An ASCII Database for Fast Queries of Relatively Stable Data Eric H. Herrin II and Raphael A. Finkel Computing Systems, Volume 4 Number 2
University of California Press, Berkeley CA
Schema and Tuple Trees: An Intuitive Structure for Representing Relational Data
Eric H. Herrin, II and Raphael A. Finkel Computing Systems, Volume 9, Number 2
MIT Press, Cambridge MA
Table of Contents