Method and apparatus for processing join query
AssigneeHuawei Technologies Co., Ltd.
InventorZhenhua WANG
Life of this patent
Estimating the term…
Abstract
A method and apparatus for processing join query is disclosed. The method includes: determining a frequent table combination whose emergence frequency in a historical query record is greater than a preset value, and the table combination includes a join key and tables that are joined by using the join key; creating a clustered index according to information about the join key in the frequent table combination; and performing a shuffle operation according to an index column in the clustered index, and saving records that have a same index column value into at least one data block to form a table cluster corresponding to the frequent table combination.
Claims20
A join query processing method, comprising:
- determining a frequent table combination, wherein the frequent table combination is a table combination whose emergence frequency in a historical query record is greater than a preset value, and wherein the table combination comprises a join key and tables that are joined by using the join key;
- creating a clustered index according to information about the join key in the frequent table combination, wherein a quantity of index columns in the clustered index is the same as a quantity of join keys in the frequent table combination, and wherein the clustered index is used to indicate a storage location of records that have a same index column value in the frequent table combination;
- and
- performing a shuffle operation according to the index columns in the clustered index, and centrally saving the records that have the same index column value into at least one data block to form a table cluster corresponding to the frequent table combination, wherein the records that have the same index column value are records in the tables that are joined by using the join key.
A join query processing apparatus, comprising:
- a processor, and a memory coupled to the processor;
- wherein the memory stores computer instructions, and the processor is configured to execute the instructions stored in the memory to:
- determine a frequent table combination, wherein the frequent table combination is a table combination whose emergence frequency in a historical query record is greater than a preset value, and wherein the table combination comprises a join key and tables that are joined by using the join key;
- create a clustered index according to information about the join key in the frequent table combination, wherein a quantity of index columns in the clustered index is the same as a quantity of join keys in the frequent table combination;
- and
- perform a shuffle operation according to the index columns in the clustered index created by the creation unit, and centrally save records that have a same index column value into at least one data block to form a table cluster corresponding to the frequent table combination, wherein the records that have the same index column value are records in the tables that are joined by using the join key.
A non-transitory computer storage medium storing computer software instructions which, when executed by a master node, causes the master node to perform the following operations:
- determining a frequent table combination, wherein the frequent table combination is a table combination whose emergence frequency in a historical query record is greater than a preset value, and wherein the table combination comprises a join key and tables that are joined by using the join key;
- creating a clustered index according to information about the join key in the frequent table combination, wherein a quantity of index columns in the clustered index is the same as a quantity of join keys in the frequent table combination, and wherein the clustered index is used to indicate a storage location of records that have a same index column value in the frequent table combination;
- and
- performing a shuffle operation according to the index columns in the clustered index, and centrally saving the records that have the same index column value into at least one data block to form a table cluster corresponding to the frequent table combination, wherein the records that have the same index column value are records in the tables that are joined by using the join key.
Dependencies are inferred from the claim text.