×

System and method of client server aggregate transformation

  • US 7,428,532 B2
  • Filed: 05/27/2004
  • Issued: 09/23/2008
  • Est. Priority Date: 05/27/2003
  • Status: Active Grant
First Claim
Patent Images

1. A method of client/server aggregate transformation, the method comprising the steps of:

  • given a binary representation of a structured query language/online analytical programming query (SQL/OLAP);

    analyzing a client/server select list to determine that a transformation is to be performed, the step of determining that a transformation is to be performed comprising the steps of;

    assigning a group index to all aggregate nodes;

    storing control breaks in an ordered list; and

    determining whether certain criteria are met, the certain criteria comprising;

    a keyword DISTINCT is present in the select list;

    all aggregates in the select list are eligible;

    all control breaks in the ordered list are compatible with other control breaks in the ordered list, where when the longest control break in the ordered list is of the form (C1, C2, . . . , Cn), then all other control breaks are of the form (C1, C2, . . . , Ck), where 0≦

    k≦

    n.; and

    one of;



    any simple column reference in the select list that is not part of an aggregate specification is contained in the longest control break;

    or 

    any simple column reference in the select list that is not part of an aggregate specification is part of an expression contained in the longest control break;

    generating a derived table comprising standard aggregate nodes and a GROUP BY clause;

    traversing all expressions in a main select list;

    adding expression nodes that are grouping column nodes of a longest control break in the query to a derived table select list; and

    converting and moving eligible aggregate nodes from the main select list into the derived table select list, said eligible aggregate nodes being windowed aggregate nodes that;

    do not have a window frame specification; and

    have standard aggregate counterparts;

    wherein the step of converting and moving comprises the steps of;

    applying the following transformation;

    replacing an aggregate of the form AVG (C0) OVER( ) with an expression of the form SUM (SUM(C0)) OVER( )/SUM (COUNT(C0)) OVER( ) and moving nested aggregates into an inner select list; and

    replacing an aggregate of the form AVG (C0) OVER (PARTITION BY C1, C2, . . . , Ck) with an expression of the form SUM (SUM(C0)) OVER (PARTITION BY C1, C2, . . . , Ck)/SUM (COUNT(C0)) OVER (PARTITION BY C1, C2, . . . , Ck) and moving nested aggregates into the inner select list;

    wherein;

    m equals a total number of unique control breaks;

    k equals a total number of grouping columns of a control break of an online analytical programming function in the query;

    n equals a total number of columns in the longest control break;

    one of;



    m>

    1 or 

    k≠

    n; and



    C0, C1, C2, . . . , Ckrepresent indexed columns in a control break in the query.

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