Patent GB-1280487-A (GB)
Title: Multilevel compressed index searching
IPC: G06F12/00
Filed: 1970-06-15
Abstract: 1280487 Data storage INTERNATIONAL BUSINESS MACHINES CORP 15 June 1970 [26 June 1969] 28780/70 Heading G4C A system for searching for a search argument in an index of compressed keys compares bytes of the argument with successive keys and increments a " search argument equal " counter to indicate a current searched-for byte position of the argument upon each key byte comparing equal with a current searched-for byte of the argument. A multi-level index of compressed keys is initially constructed from a lowest level of sorted uncompressed keys (each associated with a pointer to a respective record &c.) as follows. Each level is in the form of a series of blocks of keys. The pair of uncompressed keys bracketing each inter-block boundary of a given level form a pair of uncompressed keys of the next higher level, associated with a pointer to the first of the related blocks on the given level. As each given level of uncompressed keys is used to derive the next higher level of uncompressed keys, the keys of the given level are compressed by comparing each given uncompressed key with the next, a compressed key corresponding to the given uncompressed key being formed of the numerical position of the first unequal pair of bytes together with the values of this byte in the second of the compared keys and any preceding bytes back to that (if any) included in the previous compressed key. A multi-level search can be done from any level down using a pointer table to access the required block (there may be only one, in the case of the highest level) in the starting level, sequential comparison of search argument bytes with key bytes in a given block stopping if a compare high is obtained (this will occur with the last key in the block if not sooner) when the associated pointer in the block is used to reach the respective block in the next lower level, and so on, a pointer to the desired record being finally obtained from the lowest level. The " search argument equal " counter is reset at the beginning of each block. The record includes the corresponding uncompressed key which is then compared with the search argument. A search can also be done in a given level either sequentially through the entire level, or as a binary search of the level, or as a binary search followed by a sequential search after a certain point is reached, in each case by supplying a sequence of pointers from the pointer table as appropriate. A binary search searches the centre block of the level, then the centre block of the first or second half of the level according to the result, and so on, the pointer corresponding to the first compare high in a given block being read-out, the search continuing (in the first or second half of the level respectively) if the first or last pointer of a block is read-out, until a block is reached from which an intermediate pointer is read out (this being the required pointer), or the last binary search level is reached (in which case the last pointer read-out is correct) or two adjacent pointers in different sort-adjacent blocks are read-out. In the last case each pointer is used to initiate a multi-level search of lower levels to find which record finally retrieved has the correct uncompressed key. In a sequential onelevel search, if the point read out of a block (as corresponding to the first compare high) is the last in the block, the search continues to the next block to determine (1) if this last pointer correctly indexes the search argument or (2) if further searching is required to find the correct pointer. In case (1) there are two pointers readout (last of one block, first of next) and a multilevel search is started from each as above. If, at the end of a binary search, the first or last pointer of a block is read out (rather than an intermediate one), the adjacent pointer in the adjacent block is also obtained by a sequential search (of one or two blocks), or this dual pointer situation may be detected by examining " search-made ", " first or last pointer ", and " search-completion " bits in the pointer table.