摘要:
A system and computer readable medium for executing a query to access data stored in a database, wherein the query includes a plurality of DISTINCT keys, is disclosed. The system and computer readable medium includes a capture module for identifying each of the plurality of DISTINCT keys in the query and a sort module coupled to the capture module for determining if more than one sort is needed to execute the query, performing a first DISTINCT operation on a first DISTINCT key of the plurality of DISTINCT keys, storing data fetched from the first DISTINCT operation in a master workfile only if more than one sort process is needed to execute the query, and utilizing the master workfile to perform subsequent DISTINCT operations on the other of the plurality of DISTINCT keys.
摘要:
A system and computer readable medium for executing a query to access data stored in a database, wherein the query includes a plurality of DISTINCT keys, is disclosed. The system and computer readable medium includes a capture module for identifying each of the plurality of DISTINCT keys in the query and a sort module coupled to the capture module for determining if more than one sort is needed to execute the query, performing a first DISTINCT operation on a first DISTINCT key of the plurality of DISTINCT keys, storing data fetched from the first DISTINCT operation in a master workfile only if more than one sort process is needed to execute the query, and utilizing the master workfile to perform subsequent DISTINCT operations on the other of the plurality of DISTINCT keys.
摘要:
A method for executing a query to access data stored in a database, wherein the query includes a plurality of DISTINCT keys, is disclosed. The method of the present invention includes providing a first DISTINCT operation on a first DISTINCT key, storing data fetched from the first DISTINCT operation in a master workfile if more than one sort process is needed to execute the query, and utilizing the master workfile to perform subsequent DISTINCT operations for the other DISTINCT keys.
摘要:
Fetching an ordered first N rows of a table, includes: reading a row in the table; determining that the read row qualifies as the first N rows of the table for rows read so far, and storing data of the read row; and determining an order of data of qualifying rows and storing the order. Only data in rows that qualify to be among the first N rows are ordered and stored. This provides a significantly more efficient processing. It eliminates tournament tree sorts, corresponding work file read and write I/O's, and associated CPU time. This reduces the time for the running of a query and improves the performance of other applications sharing the use of work files. Further, the improved performance is particular significant when the buffer sizes are within a page of records or rows, although multiple pages may be used.
摘要:
An apparatus and method for efficiently performing a query sort on a data set with duplicate key values is disclosed. The method includes identifying unique key values for a key in a data set after determining that a number of duplicate key values for the key exceed a predefined threshold. The method also includes recording an association of each unique key value with a record in the data set and sorting unique key values. The method further includes storing the unique key values in a sorted order, wherein each unique key value is associated with an appropriate record in the data set.
摘要:
A method for fetching an ordered first N rows of a table, includes: reading a row in the table; determining that the read row qualifies as the first N rows of the table for rows read so far, and storing data of the read row; and determining an order of data of qualifying rows and storing the order. Only data in rows that qualify to be among the first N rows are ordered and stored. This provides a significantly more efficient processing. It eliminates tournament tree sorts, corresponding work file read and write I/O's, and associated CPU time. This reduces the time for the running of a query and improves the performance of other applications sharing the use of work files. Further, the improved performance is particular significant when the buffer sizes are within a page of records or rows, although multiple pages may be used.
摘要:
An apparatus and method for efficiently performing a query sort on a data set with duplicate key values is disclosed. The method includes identifying unique key values for a key in a data set after determining that a number of duplicate key values for the key exceed a predefined threshold. The method also includes recording an association of each unique key value with a record in the data set and sorting unique key values. The method further includes storing the unique key values in a sorted order, wherein each unique key value is associated with an appropriate record in the data set.