man page(1) manual page
Table of Contents

NAME

qddb_keylist - Manipulate a Qddb KeyList.

SYNOPSIS

qddb_keylist operation <op> <options> [-exact on|off] <keylist_desc1> <keylist_desc2> qddb_keylist process prune -prunebyattr attr <options> <keylist_desc> qddb_keylist process prune -prunebyrow attrlist <options> <keylist_desc> qddb_keylist process sort|nullop <options> <keylist_desc> qddb_keylist get <keylist_desc>
qddb_keylist delete <keylist_desc>|all

OPTIONS

<op> is one of intersection|union|exclusion.

<options> may be any combination of:
-copy on|off
-deldup_sameentry on|off
-deldup_sameattr on|off

DESCRIPTION

qddb_keylist performs various operations on keylists described by keylist descriptors.

<keylist_desc> is returned by qddb_search(n). It is a token to an internal Qddb data structure that is difficult to deal with under TCL. Each node of a KeyList uniquely describes exactly one tuple and the attribute/instance within that tuple that matched a query.

attr is the name of a valid attribute for the schema. For example, Client.Name.First might be a valid attribute name. attrlist is a list of attributes used to find the elements of the provided keylist.

<options> specify the side effects for the operation. If -copy is on (the default is off), then the result is a copy and the original two keylist arguments are untouched. If -copy is off, then the original two arguments are automatically deleted. "-deldup_sameentry on" deletes any duplicate nodes within the same entry, returning a keylist where each node is a unique tuple in the relation. "-deldup_sameattr on" deletes nodes that match exactly, including the attribute and instance numbers.

qddb_keylist operation
performs the given operation (union, intersection, or exclusion) on the two keylist arguments. If -exact is on, comparisons are performed using exact matching on the keylists, including instance and attribute. If -exact is off, comparisons are performed using only the quadruples (offset, length, number, type). -exact is useful for finding multiple keys in a single instance of one attribute.

qddb_keylist process prune
requires at least one of:
-prunebyattr attr
-prunebyrow attrlist
-prunebyattr prunes the keylist of all nodes not matching the given attribute. -prunebyrow prunes the keylist of all nodes that are not part of a single row containing a match for each attribute in attrlist.

qddb_keylist process sort
sorts the given keylist, placing nodes referring to the same tuple next to each other. This is not necessary unless a keylist is manipulated manually somehow.

qddb_keylist process nullop
No special processing is performed except that specified by the <options>. For example, set s [qddb_schema open MyRelation] set k [qddb_search $s regexp {.*aa.*}] set k1 [qddb_keylist process nullop -copy on $k] will copy the keylist described by $k and place a new descriptor in $k1.

qddb_keylist get
converts the keylist associated with the key into a list of quadruples (offset, length, number, type). The returned list of quadruples is a proper TCL list. By typing directly into qddb_tclsh, you might see:
$ qddb_tclsh
% set s [qddb_schema open FamilyMembers] qddb_schema0
% set k [qddb_search $s word george] qddb_keylist0
% set mylist [qddb_keylist get $k] {5651458 34643 0 1} {7965698 5346 0 1} {2583639 12842 0 1} % set tuple [qddb_tuple read $s [lindex $mylist 0]] qddb_tuple0

qddb_keylist delete
deletes the internal keylist associated with the given <keylist_desc>. This must be done for each unused keylist. The special <keylist_desc> all deletes all keylist descriptors.

SEE ALSO

qddb_instance(n), qddb_rows(n), qddb_schema(n), qddb_search(n), qddb_table(n), qddb_tuple(n), qddb_util(n), qddb_view(n)

REFERENCES

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

TCL and the TK Toolkit
John K. Ousterhout
Addison-Wesley, 1994
ISBN 0-201-63337-X

DIAGNOSTICS

BUGS

None known.


Table of Contents