APPARATUS AND METHOD FOR SORTING DATA
First Claim
1. A method for sorting data of an input file stored on a first tangible storage device, said input file comprising multiple records associated with multiple tables of a database, each record of the multiple records comprising a plurality of key values, said method comprising:
- segmenting the plurality of key values in the multiple records associated with each table into ranges of key values for each table, each range of key values for each table denoted as a segment having an associated segment value;
selecting multiple key values for each record of the multiple records, said multiple key values being selected in association with the tables of the multiple tables;
generating, for each record of the multiple records, a block number comprising a unique permutation of the segment values of the segments, said segment values respectively denoting the ranges of key values encompassing the multiple key values;
ascertaining, for each record of the multiple records, a sort key value based on the generated block number for each record of the multiple records;
adding, to each record of the multiple records, the sort key value ascertained for each record of the multiple records; and
after said adding the sort key value to all records of the multiple records, sorting the multiple records according to the sort key values added to the multiple records; and
storing the sorted multiple records in an output file on a second tangible storage device.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and system for sorting data of an input file containing multiple records associated with multiple tables of a database. The multiple records include key values. The key values are segmented into ranges of key values for each table. Each range of key values for each table is a segment having a segment value. Multiple key values are selected for the multiple records. A block number, which contains a unique permutation of the segment values of the segments, is generated. The segment values denote the ranges of key values encompassing the multiple key values in each record. A sort key value for each record is ascertained, based on the generated block number for each record, and added to each record. The multiple records are sorted according to the sort key values in the multiple records. The sorted multiple records are stored in an output file.
63 Citations
20 Claims
-
1. A method for sorting data of an input file stored on a first tangible storage device, said input file comprising multiple records associated with multiple tables of a database, each record of the multiple records comprising a plurality of key values, said method comprising:
-
segmenting the plurality of key values in the multiple records associated with each table into ranges of key values for each table, each range of key values for each table denoted as a segment having an associated segment value; selecting multiple key values for each record of the multiple records, said multiple key values being selected in association with the tables of the multiple tables; generating, for each record of the multiple records, a block number comprising a unique permutation of the segment values of the segments, said segment values respectively denoting the ranges of key values encompassing the multiple key values; ascertaining, for each record of the multiple records, a sort key value based on the generated block number for each record of the multiple records; adding, to each record of the multiple records, the sort key value ascertained for each record of the multiple records; and after said adding the sort key value to all records of the multiple records, sorting the multiple records according to the sort key values added to the multiple records; and storing the sorted multiple records in an output file on a second tangible storage device. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer program product, comprising a computer readable tangible storage medium having a computer readable program code stored therein, said program code configured to be executed by a processor of a computer system to implement a method for sorting data of an input file stored on a first tangible storage device, said input file comprising multiple records associated with multiple tables of a database, each record of the multiple records comprising a plurality of key values, said method comprising:
-
segmenting the plurality of key values in the multiple records associated with each table into ranges of key values for each table, each range of key values for each table denoted as a segment having an associated segment value; selecting multiple key values for each record of the multiple records, said multiple key values being selected in association with the tables of the multiple tables; generating, for each record of the multiple records, a block number comprising a unique permutation of the segment values of the segments, said segment values respectively denoting the ranges of key values encompassing the multiple key values; ascertaining, for each record of the multiple records, a sort key value based on the generated block number for each record of the multiple records; adding, to each record of the multiple records, the sort key value ascertained for each record of the multiple records; and after said adding the sort key value to all records of the multiple records, sorting the multiple records according to the sort key values added to the multiple records; and storing the sorted multiple records in an output file on a second tangible storage device. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer system comprising a processor, a memory unit, and a computer readable tangible storage medium, said storage medium containing program code configured to be executed by the processor via the memory unit to implement a method for sorting data of an input file stored on a first tangible storage device, said input file comprising multiple records associated with multiple tables of a database, each record of the multiple records comprising a plurality of key values, said method comprising:
-
segmenting the plurality of key values in the multiple records associated with each table into ranges of key values for each table, each range of key values for each table denoted as a segment having an associated segment value; selecting multiple key values for each record of the multiple records, said multiple key values being selected in association with the tables of the multiple tables; generating, for each record of the multiple records, a block number comprising a unique permutation of the segment values of the segments, said segment values respectively denoting the ranges of key values encompassing the multiple key values; ascertaining, for each record of the multiple records, a sort key value based on the generated block number for each record of the multiple records; adding, to each record of the multiple records, the sort key value ascertained for each record of the multiple records; and after said adding the sort key value to all records of the multiple records, sorting the multiple records according to the sort key values added to the multiple records; and storing the sorted multiple records in an output file on a second tangible storage device. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification