Itzam/Core
C API Documentation (About Keys)
|
|
|
Index
General Types & Functions
Datafiles
About Keys
B-tree Indexes
B-tree Index Cursors
Hash Indexes
Sparse Matrix Indexes
Itzam indexes store "keys" -- data structures that contain data that identifies other data. Some indexes use keys to order information as well.
So what, exactly is a "key"?
To begin with, all keys of the same type must have the same physical storage size; this greatly simplifies the programming and efficiency of data structures in the index files.
Key must also be comparable in some fashion; the index must be able to determine, through a user-defined function, whether or not two keys are equal, or which key comes before the other in a sorted sequence. Since the user provides a comparison function, the ordering of keys can be as simple or complex as you'd like.
Within those two guidelines, keys can be implemented as anything from atomic types (int,
long, etc) to complex structures. In a simple database, the "key" may actually be the
complete "record", and the comparison function looks at specific elements for ordering. A more
complex application could define a key containing references to other keys or simple data records.
The way your data relates is entirely up to you.
Look at the tutorial/itzam_tutorial.c program for examples of key and records types.

