Data query method, acceleration apparatus, compute device, and storage medium
AssigneeHuawai Technologies Co., Ltd.
InventorsChangfeng Liu, Mingjian Que
Life of this patent
Estimating the term…
Abstract
A data query method, an acceleration apparatus, a compute device, and a storage medium, where the method is applied to an acceleration apparatus of a compute device. The method includes obtaining a query vector of a data query request to query data from a fact table and at least one dimension table based on a join key, and generating a vector dictionary and a vector index based on a fact table, a dimension table, and a join key that are indicated by the data query request.
Claims20
A data query method, applied to an acceleration apparatus of a compute device, wherein the method comprises:
- obtaining a query vector of a data query request, wherein the data query request indicates to query data from a fact table and at least one dimension table based on a join key, at least one foreign key of the fact table is associated with a primary key of the at least one dimension table, and the at least one dimension table is used to store dimension information of factual data in the fact table;
- generating a vector dictionary of each of the at least one dimension table based on the query vector and a vector corresponding to the dimension table, wherein the vector dictionary of each of the at least one dimension table comprises a join key value that is of the join key and that is related to the query vector in the dimension table;
- traversing the at least one dimension table based on the at least one foreign key of the fact table, the primary key of the at least one dimension table, and the vector dictionary of each of the at least one dimension table, to generate a vector index, wherein the vector index comprises a fact table identifier in the fact table for the join key value;
- and
- querying the fact table based on the vector index, to obtain a data query result.
An acceleration apparatus, configured in a compute device, comprising:
- one or more processors;
- and
- one or more memories coupled to the one or more processors and storing programming instructions for execution by the one or more processors to cause the acceleration apparatus to:
- obtain a query vector of a data query request, wherein the data query request indicates to query data from a fact table and at least one dimension table based on a join key, at least one foreign key of the fact table is associated with a primary key of the at least one dimension table, and the at least one dimension table is used to store dimension information of factual data in the fact table;
- generate a vector dictionary of each of the at least one dimension table based on the query vector and a vector corresponding to the dimension table, wherein the vector dictionary of each of the at least one dimension table comprises a join key value that is of the join key and that is related to the query vector in the dimension table;
- traverse the at least one dimension table based on the at least one foreign key of the fact table, the primary key of the at least one dimension table, and the vector dictionary of each of the at least one dimension table, to generate a vector index, wherein the vector index comprises a fact table identifier in the fact table for the join key value;
- and
- query the fact table based on the vector index, to obtain a data query result.
A compute device, comprising:
- an acceleration apparatus;
- and
- a host configured to send a data query request to the acceleration apparatus;
- wherein the acceleration apparatus is configured to:
- receive the data query request;
- obtain a query vector of the data query request, wherein the data query request indicates to query data from a fact table and at least one dimension table based on a join key, at least one foreign key of the fact table is associated with a primary key of the at least one dimension table, and the at least one dimension table is used to store dimension information of factual data in the fact table;
- generate a vector dictionary of each of the at least one dimension table based on the query vector and a vector corresponding to the dimension table, wherein the vector dictionary of each of the at least one dimension table comprises a join key value that is of the join key and that is related to the query vector in the dimension table;
- traverse the at least one dimension table based on the at least one foreign key of the fact table, the primary key of the at least one dimension table, and the vector dictionary of each of the at least one dimension table, to generate a vector index, wherein the vector index comprises a fact table identifier in the fact table for the join key value;
- and
- query the fact table based on the vector index, to obtain a data query result.
Dependencies are inferred from the claim text.