Table 157 shows which search methods may be used with each type of table organization. Illegal combinations are indicated by dashes (—-).
Search Method |
||||||
---|---|---|---|---|---|---|
Organization |
S – Serial |
B – Binary |
C – Bounded Binary |
Q – Queued |
H – Hash |
|
R |
Random |
Default |
—- |
—- |
—- |
—- |
U |
User Ordered |
Default |
—- |
—- |
—- |
—- |
S |
Sequential |
—- |
Default |
OK |
OK |
—- |
D |
Descending Sequential |
—- |
Default |
OK |
OK |
—- |
H |
Hash |
—- |
—- |
—- |
—- |
Default |
In general, you will choose the organization and search method as a pair. For many applications, you can specify the organization and tablesONLINE will fill in the default search method automatically. For random, user ordered or hashed tables, there is only one search method.
Ascending sequential and descending sequential tables offer a choice of search methods. For these, Binary search is the reliable default choice. Bounded binary and queued searches perform better in special cases, but are also subject to greater performance degradation if their conditions (fairly consistent size for bounded binary and an ordered data source for queued) are not met.