×

Optimizing processing of group-by queries featuring maximum or minimum equality conditions in a parallel processing system

  • US 10,459,912 B2
  • Filed: 04/13/2012
  • Issued: 10/29/2019
  • Est. Priority Date: 12/11/2008
  • Status: Active Grant
First Claim
Patent Images

1. A method of optimizing processing of a query specifying an equality condition on an attribute of a table in a parallel processing system, comprising:

  • receiving, by a processing module of a plurality of processing modules deployed in the parallel processing system, the query that specifies the equality condition on the attribute of the table, wherein the processing module has a subset of rows of the table allocated thereto;

    initializing, by the processing module, a hash table including a first field for a selected attribute of the query and at least one second field for the attribute on which the equality condition is applied and a row of the subset of rows;

    identifying, by the processing module, each row of the subset of rows that satisfies the equality condition by at least;

    evaluating, by the processing module, the selected attribute of each row of the subset of rows; and

    determining if a row of the hash table includes a row having the selected attribute;

    storing, by the processing module, the selected attribute of each row of the subset of rows identified as satisfying the equality condition in the first field of a respective row of the hash table, and the value of attribute on which the equality condition is applied and the row identified as satisfying the equality condition in the at least one second field of the respective row of the hash table;

    redistributing each row of the hash table, associated with the equality condition, to a respective one of the plurality of processing modules based on a hash value of the selected attribute;

    after the redistributing each row of the hash table based on a hash value of the selected attribute, receiving, by the respective one of the plurality of the processing modules, a global value of each attribute of the table on which the equality condition is applied that respectively specifies a maximum value of the attribute on which the equality condition is applied for a corresponding selected attribute in the event the equality condition comprises a maximum equality condition and that respectively specifies a minimum value of the attribute on which the equality condition is applied for a corresponding selected attribute in the event the equality condition comprises a minimum equality condition;

    after the redistributing each row of the hash table based on a hash value of the selected attribute, comparing by the respective one of the plurality of the processing modules each global value of each attribute with a value of the attribute on which the equality condition is applied of a corresponding selected attribute stored in the hash table;

    after the redistributing each row of the hash table based on a hash value of the selected attribute, discarding by the respective one of the plurality of the processing modules a row of the hash table in the event the value of the attribute of the row of the hash table is less than the global value for the selected attribute in the event the equality condition comprises a maximum equality condition; and

    after the redistributing each row of the hash table based on a hash value of the selected attribute, maintaining by the respective one of the plurality of the processing modules a row of the hash table in the event the value of the attribute of the row of the hash table equals the global value for the selected attribute.

View all claims
  • 0 Assignments
Timeline View
Assignment View
    ×
    ×