×

Use of dynamic dictionary encoding with an associated hash table to support many-to-many joins and aggregations

  • US 10,067,954 B2
  • Filed: 07/22/2015
  • Issued: 09/04/2018
  • Est. Priority Date: 07/22/2015
  • Status: Active Grant
First Claim
Patent Images

1. A method comprising:

  • receiving a query at a database server executing on a computing device;

    wherein the query specifies;

    a grouping operation that groups rows from a second table based on values from a grouped-by column of a first table;

    a join operation that joins rows from the second table based on values from a joined-by column of the first table;

    creating, within storage of the computing device, a dense grouping key value-to-join key (DGK-JK) value mapping data structure that comprises a first dense grouping key (DGK) column;

    wherein the first DGK column includes a first plurality of dense grouping key (DGK) values and one or more instances of a flag value;

    wherein each entry in the DGK-JK value mapping data structure includes either;

    one of the first plurality of DGK values at a location within the DGK-JK value mapping data structure, wherein the location corresponds to a particular join key value from a plurality of join key values from the joined-by column of the first table, oran instance of the flag value at the location within the DGK-JK value mapping data structure, wherein the location corresponds to the particular join key value from the plurality of join key values from the joined-by column of the first table;

    creating, within the storage of the computing device, a dense grouping key value-to-grouping key (DGK-GK) value mapping data structure that comprises a grouping key column and a second dense grouping key (DGK) column;

    wherein the grouping key column includes a plurality of group-by key values from the grouped-by column of the first table;

    wherein the second DGK column includes a second plurality of DGK values;

    wherein each entry in the DGK-GK value mapping data structure includes one of the plurality of group-by key values, and a corresponding one of the second plurality of DGK values;

    creating, within the storage of the computing device, a multiple dense grouping key values-to-join key (multi-DGK-JK) value mapping data structure that is a hash table that includes a hash bucket for each join key value that corresponds to a respective instance of the flag value;

    wherein applying a hash function to a given join key value that corresponds to a given instance of the flag value indicates a location of the hash bucket that corresponds to the given join key value;

    within the hash bucket for the given join key value, storing an indication of a given plurality of DGK values with which the given join key value is associated;

    using the multi-DGK-JK mapping structure, in the grouping operation, as a join-key value hash-based index to the given plurality of DGK values;

    determining a result set for the query by performing the grouping operation and the join operation using the DGK-JK value mapping data structure and the multi-DGK-JK value mapping data structure, the DGK-JK value mapping data structure and the multi-DGK-JK value mapping data structure matching the plurality of join key values from the joined-by column of the first table with the second plurality of DGK values;

    wherein the method is performed by one or more computing devices.

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