Search

CN-100440212-C - Methods and apparatus for processing a database query

CN100440212CCN 100440212 CCN100440212 CCN 100440212CCN-100440212-C

Abstract

In a first aspect, a method is provided that includes the steps of (1) pre-computing a query result for each of a plurality of whole segments of data included in a database; (2) receiving a query specifying a defined range of data in the database; (3) determining if any of the whole segments are within the defined range; (4) performing the query on any partial segments of data within the defined range; and (5) determining the result of the query based on the pre-computed query results for any whole segments determined to be within the defined range and the result of the query on any partial segments within the defined range. Numerous other aspects are provided.

Inventors

  • BARSNESS ERICI L.
  • SANTOSUOSSO JOHN M.

Assignees

  • IBM

Dates

Publication Date
20081203
Application Date
20051013
Priority Date
20041014

Claims (20)

  1. 1. method comprises: Calculate Query Result in advance to each of a plurality of complete segment data of comprising in the database; The inquiry of the data area that defines in the database has been specified in reception; Determine whether any complete segment is arranged within defined scope; Any part segment data within the defined scope is carried out inquiry; And Based on determining, and determine the result of this inquiry at the precalculated Query Result of any complete segment within the defined scope and to the Query Result of any part section within the defined scope.
  2. 2. according to the method for claim 1, wherein determine that at the precalculated Query Result of any complete segment within the defined scope and to the Query Result of any part section within the defined scope result's of this inquiry step comprises: by this precalculated Query Result of retrieval based on determining, and definite Query Result to any part segment data in the defined scope, and the result of definite this inquiry.
  3. 3. according to the method for claim 1, also comprise: The precalculated Query Result of storage in database; And From database, remove the precalculated Query Result of carrying out greater than the data of the date range of specifying the time limit.
  4. 4. according to the process of claim 1 wherein that the data in the database are grouped into one or more complete segment and segment section based on the date with this data association.
  5. 5. according to the method for claim 1, each the step of wherein calculating in advance a plurality of complete segment data of comprising in the database of Query Result comprises: in response to receiving the inquiry of having specified the data area that defines in the database, and calculate Query Result to each of a plurality of complete segment data of comprising in the database in advance.
  6. 6. one kind is used to handle the method that database of information is inquired about, and comprising: The request of inquiry is carried out in reception to the first's data in the database; Determine the Query Result of the first of database based at least one result of calculation in advance, wherein this in advance result of calculation be to being included in the Query Result of the second portion data in the first in the database; Third part data in the database are carried out inquiry, and wherein this third part is the part except second portion in the first; And Based on this result of calculation and to the Query Result of third part and calculate Query Result in advance to first.
  7. 7. according to the method for claim 6, wherein based on this in advance result of calculation and to the Query Result of third part and the step of calculating the Query Result of first comprise: merge this result of calculation and to the Query Result of third part data in advance.
  8. 8. according to the method for claim 6, wherein these second portion data are more than these third part data.
  9. 9. according to the method for claim 6, wherein based on this in advance result of calculation and to the Query Result of third part and the step of calculating the Query Result of first comprise: by retrieving this result of calculation in advance, and calculate Query Result to third part, and calculate Query Result to first.
  10. 10. according to the method for claim 6, also comprise: The precalculated Query Result of storage in database; And From database, remove the precalculated Query Result of carrying out greater than the data of the date range of specifying the time limit.
  11. 11. according to the method for claim 6, wherein the data in the database are based on be grouped into first, second and third part data with the date of this data association.
  12. 12. according to the method for claim 11, wherein day, at least one and this second portion data association in the Month And Year.
  13. 13., wherein carry out the request of inquiring about, and calculate this result of calculation in advance in response to the first's data that receive in the database according to the method for claim 6.
  14. 14. the method according to claim 6 also comprises: Monitor this result of calculation in advance; And Determine whether to continue to store this result of calculation in advance based on monitoring.
  15. 15. an equipment comprises: Be used for calculating in advance each the unit of Query Result of a plurality of complete segment data that database is comprised; Be used for receiving the unit of the inquiry of having specified the data area that database defines; Be used to determine within the scope of this definition, whether to have the unit of any complete segment; Be used for any part segment data within the defined scope is carried out the unit of inquiry; And Be used for based on determining, and determine the result's of this inquiry unit at the precalculated Query Result of any complete segment within the defined scope and to the Query Result of any part section within the defined scope.
  16. 16. equipment according to claim 15, wherein be used for determining that at the precalculated Query Result of any complete segment within the defined scope and to the Query Result of any part section within the defined scope result's of this inquiry unit comprises: be used for by this precalculated Query Result of retrieval based on determining, and definite Query Result to any part segment data within the defined scope, and the result's of definite this inquiry unit.
  17. 17. the equipment according to claim 15 wherein also comprises: Be used for unit at this precalculated Query Result of database storage; And Be used for removing unit to the precalculated Query Result of carrying out greater than the data of the date range of specifying the time limit from database.
  18. 18. according to the equipment of claim 15, wherein the data in the database are based on be grouped into one or more complete segment and segment section with the date of this data association.
  19. 19. equipment according to claim 15, each the unit of Query Result that wherein is used for calculating in advance a plurality of complete segment data that database is comprised comprises: be used for the inquiry of having specified the data area that database defines in response to receiving, and calculate the unit of Query Result to each of a plurality of complete segment data of comprising in the database in advance.
  20. 20. an equipment that is used for the deal with data library inquiry comprises: Be used for receiving the unit of first's data of database being carried out the request of inquiry; Be used for determining to the Query Result of the first of database based on the unit of result of calculation in advance, wherein this in advance result of calculation be to being included in the Query Result of the second portion data in the first in the database; Be used for the third part data of database are carried out the unit of inquiry, wherein this third part is the part except second portion in the first; And Be used for based on this result of calculation and to the Query Result of third part and calculate unit in advance the Query Result of first.

Description

The method and apparatus that is used for the deal with data library inquiry Technical field The present invention relates generally to computer system, and relate more specifically to be used for the method and apparatus of deal with data library inquiry. Background technology Database receives the inquiry such as information such as summation, mean values to certain data area in the database continually.Traditionally, in response to this class inquiry, every record in this data area of database access is to handle this inquiry, and wherein each record comprises one or more data item.Yet the method for this deal with data library inquiry causes big processing expenditure. Therefore, expectation is used for the method and apparatus of the improvement processing of data base querying. Summary of the invention According to a first aspect of the invention, provide first method.This first method may further comprise the steps: (1) calculates the Query Result to each of a plurality of complete segment data that comprise in the database in advance; (2) receive the inquiry of having specified the data area that defines in the database; (3) determine whether any complete segment is arranged within defined scope; (4) any part segment data within the defined scope is carried out inquiry; And (5) based on determining at the precalculated Query Result of any complete segment within the defined scope and to the Query Result of any part section within the defined scope, and determine the result of this inquiry. According to a second aspect of the invention, provide a kind of method that is used to handle to the database of information inquiry.This method may further comprise the steps: (1) receives the request of the first's data in the database being carried out inquiry; (2) determine the Query Result of the first of database based at least one result of calculation in advance, wherein this in advance result of calculation be to being included in the Query Result of the second portion data in the first in the database; (3) the third part data in the database are carried out inquiry, wherein this third part is the part except second portion in the first; And (4) are based on this result of calculation and to the Query Result of third part and calculate Query Result to first in advance.Many other aspects are also provided, as these otherwise methods, system, equipment and computer program according to the present invention.Each computer program described herein can be carried by computer-readable medium (for example carrier signal, floppy disk, compact disk, DVD, hard disk drive, random access memory etc.). According to following detailed description, claims and accompanying drawing, other features of the present invention and aspect will become clearer. Description of drawings Fig. 1 is the block scheme that is used for the equipment of deal with data library inquiry according to an embodiment of the invention. Fig. 2 is the block scheme of the example of the database that can use at the equipment that is used for the deal with data library inquiry according to an embodiment of the invention. Fig. 3 is first exemplary method that is used for the deal with data library inquiry according to an embodiment of the invention. Fig. 4 is second exemplary method that is used for the deal with data library inquiry according to an embodiment of the invention. Embodiment The invention provides the method and apparatus that is used for effective deal with data library inquiry.More specifically, this method and equipment have avoided having to visit the major part (for example gamut) by the scope of data base querying appointment.As a result, compare with the traditional database query processing, this method and equipment provide the performance gain that is used for the deal with data library inquiry. Fig. 1 is the block scheme that is used for the equipment of deal with data library inquiry according to an embodiment of the invention.With reference to figure 1, this equipment 100 that is used for the deal with data library inquiry comprises and couples with processor 104 and be used to store memory of data 102.The memory storage 106 of this processor 104 and for example disk drive that includes database 108 etc. couples.Details below with reference to Fig. 2 descriptive data base 108.Processor 104 is adapted for the code that operation is adapted for effective Query Database 108.More specifically, processor 104 is adapted for operation and is adapted for the execution code of first and/or second exemplary method according to an embodiment of the invention.Below the details of first and second exemplary methods will be described with reference to figure 3 and 4 respectively.In addition, equipment 100 can comprise and is used for (for example com) port one 10 of communicating by letter that communicates with other equipment. Fig. 2 is the block scheme of the example of the database that can use at the equipment that is used for the d