×

Apparatus and system for reducing locking in materialized query tables

  • US 8,112,414 B2
  • Filed: 08/28/2008
  • Issued: 02/07/2012
  • Est. Priority Date: 08/28/2008
  • Status: Expired due to Fees
  • ×
    • Pin Icon | RPX Insight
    • Pin
First Claim
Patent Images

1. A computer program product stored on a computer-readable medium for reducing the locking of Materialized Query Tables (MQTs), the computer program product comprising:

  • a MQT definition query defining the aggregates within a MQT as distributive;

    an insert module configured to perform an insert operation on the MQT that adds a child row to a MQT without refreshing the MQT in response to an insert operation inserting a base table row in a base table referenced by the MQT,wherein the added child row comprises;

    one or more foreign key column values;

    a unique identifier relating the child row and an existing parent row; and

    one or more measure values corresponding to one or more insert values of the insert operation in the base table; and

    a delete module configured to perform an insert operation on the MQT that adds a child row to the MQT without refreshing the MQT in response to a delete operation deleting a base table row in the base table referenced by the MQT, wherein the added child row comprises;

    one or more foreign key column values;

    a unique identifier relating the child row and an existing parent row; and

    one or more measure values having the negative of the measure values of the base table row that is the subject of the delete operation;

    an update module configured to add two child rows to the MQT without refreshing the MQT in response to an update operation updating a base table row in the base table referenced by the MQT with one or more new values;

    wherein the first added child row comprises;

    one or more foreign key column values;

    a unique identifier relating the child row and an existing parent row; and

    one or more measure values having the negative of the measure values of the base table row that is the subject of the update operation; and

    wherein the second added child row comprises;

    one or more foreign key column values;

    a unique identifier relating the second added child row and the first added child row; and

    one or more measure values corresponding to one or more update values of the update operation in the base table;

    an execution module configured to provide a value in response to a query requesting values associated with a particular foreign key by summing all measure values in the MQT sharing the particular foreign key, wherein the summation is executed in an order specified by the unique identifier; and

    a consolidation module that executes an aggregation operation that aggregates all records in the MQT having the same foreign key into a single row entry without refreshing the MQT from the base table, wherein the consolidation module is further configured to determine;

    that there are sufficient CPU cycles available to execute the aggregation operation without negatively impacting an associated computing system, and wherein the consolidation module initiates aggregation in response to determining that there are sufficient CPU cycles;

    that a predetermined time period has passed since a last aggregation operation, and wherein the consolidation module initiates aggregation in response to determining that the predetermined time period has passed; and

    that a cost of aggregating the MQT is less than a cost of executing a query referencing the MQT without aggregation, and wherein the consolidation module initiates aggregation in response to determining that the cost of aggregating the MQT is less than a cost of executing the query referencing the MQT without aggregation.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×