Search Method

Specify the search method of the table. Valid values are S, Q, B, C, and H.

S (Serial)

A Serial search starts at the first row and searches the table until a match is found or the end of the table is reached. Serial search is useful when rows can be ordered by frequency of access and when the table is small and, consequently, does not require a more complex search.

Q (Queued)

A form of Serial search where each search starts where the previous search finished. Queued search works only with Sequential or Descending tables.

B (Binary)

A Binary search compares the key to the middle row of an ascending or descending Sequential table to determine which half of the table might contain the row, then compares the key to the middle row of that half to determine which quarter of the table might have the row, and so on.

C (Bounded Binary)

The bounded binary search process compares the search key to the endpoints of an Index to determine if the search key is within the Index range. If the search key is not within the range, then the system returns a “not found” message. If the search key is within the range, then a binary search process is used to find the key position.

A bounded binary search is a fast technique for performing inserts into ordered data.

The table organization must be ascending or descending S (Sequential).

Note:
Any screen reference to “Tree Binary” indicates that the search method is Bounded Binary.
H (Hash)

During a Hash search, the table is searched by a hash function.

Retrieval time remains constant for any table size, provided that the table becomes neither full enough to cause problems nor large enough to cause heavy paging activity.

Organization and search method are closely related. For most applications, only the organization needs to be specified, and tablesONLINE fills in the search method with a default value.

Table 194 shows the search methods that are valid with each table organization.

Table 194. Search Method and Table Organization

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