United States Patent [19]
Green
[li] Patent Number: 4,829,427 [45] Date of Patent: May 9, 1989
[54] DATABASE QUERY CODE GENERATION AND OPTIMIZATION BASED ON THE COST OF ALTERNATE ACCESS METHODS
[75] Inventor: Nancy L. Green, Raleigh, N.C.
[73] Assignee: Data General Corporation, Westboro, Mass.
[21] Appl. No.: 614,416
[22] Filed: May 25,1984
[51] Int. Q.4 G06F 15/00
[52] U.S. a 364/300; 364/200
[58] Field of Search ... 364/200 MS File, 900 MS File,
364/300
[56] References Cited
U.S. PATENT DOCUMENTS
3,906,455 9/1975 Houston et al 364/200
3,916,387 10/1975 Woodrum 364/200
4,130,867 12/1978 Bachman et al 364/200
4.384.325 3/1983 Slechta, Jr. et al 364/200
4,468,728 8/1984 Wang 364/200
4,497,039 1/1985 Kitakami et al 364/900
4,504,907 3/1985 Manning et al 364/200
4.506.326 3/1985 Shaw et al 364/300
4,531,186 7/1985 Knapman 364/300
Primary Examiner—Raulfe B. Zache
Assistant Examiner—Florin Munteanu
[57] ABSTRACT
An optimizer-code generator for use in a data base system. The optimizer-code generator employs a component called a scan analyzer for performing implementation-dependent analysis and providing implementation-dependent query code. The optimizer-code generator receives a query in logical tree form. It first optimizes the logical tree. In so doing, it provides information from the logical tree to the scan analyzer, which specifies what methods are available for accessing information required for the query and what each of the available methods costs. The optimizer-code generator uses the cost information in its optimization of the logical tree and specifies the access methods to be used in the logical tree. The code generator then uses the logical tree to generate query code. In so doing, it provides the specifications of the access methods to the scan analyzer, which returns query code for the access method. The code generator then incorporates the query code for the access method in the query code which it generates from the logical tree.
11 Claims, 15 Drawing Sheets
![[table][merged small][merged small][table][graphic][merged small][merged small][merged small][merged small][merged small]](http://www.google.fr/patents?id=T3QWAAAAEBAJ&hl=fr&ie=ISO-8859-1&output=text&pg=PA1&img=1&zoom=3&hl=fr&q=&cds=1&sig=ACfU3U1fAYwH16-hN2i57XLOTIdMWNv5zA&edge=0&edge=stretch&ci=145,814,721,282)