Processing a database query using a shared metadata store
AssigneeEMC IP Holding Company LLC
InventorsCaleb Welton, Hitoshi Harada, Jeffrey Cohen, Lei Chang, Radhika Reddy, Tao Ma, Zhanwei Wang
Life of this patent
Estimating the term…
Abstract
A method and system for executing a query in parallel is disclosed. A master node may receive a query from a client and develop query plans from that query. The query plans may be forwarded to worker nodes for execution, and each query plan may be accompanied by query metadata. The metadata may be stored in a catalog on the master node.
Claims18
A method, comprising:
- receiving a query at a master node, the master node having access to a database catalog that comprises metadata defining database objects;
- in response to receiving the query, initiating a catalog server session, taking a snapshot of the metadata, and associating the snapshot of the metadata with the catalog server session, wherein a separate catalog server session is initiated and a separate snapshot of the metadata is taken for a separate query that is not the same as the query received at the master node;
- communicating a query plan and query metadata to a worker node, wherein the query plan is generated based at least in part on the query, the query metadata includes metadata to be used in connection with execution of the query plan, the query metadata is obtained based at least in part on the snapshot of the metadata associated with the catalog server session, and the query metadata is communicated to the worker node contemporaneous with respect to the query plan;
- in response to receiving the query plan and the query metadata, determining, by the worker node, that additional metadata is required for the worker node to execute the query plan;
- in response to determining that additional metadata is required, requesting, by the worker node, the additional metadata, wherein the worker node queries a parent in a tree structure of a plurality of worker nodes in a parallel processing database system for the additional metadata, and the parent node is a node between the master node and the worker node in relation to the tree structure;
- receiving the additional metadata from another worker node, wherein the additional metadata is retrieved from a same session as the catalog server session corresponding to the query;
- executing the query plan on the worker node;
- and
- returning, to the master node, a result associated with the execution of the query plan on the worker node.
A computer program product for executing queries in a parallel processing database system, comprising a non-transitory computer readable medium having program instructions embodied therein for:
- receiving a query at a master node, the master node having access to a database catalog that comprises metadata defining database objects;
- in response to receiving the query, initiating a catalog server session, taking a snapshot of the metadata, and associating the snapshot of the metadata with the catalog server session, wherein a separate catalog server session is initiated and a separate snapshot of the metadata is taken for a separate query that is not the same as the query received at the master node;
- communicating a query plan and query metadata to a worker node, wherein the query plan is generated based at least in part on the query, the query metadata includes metadata to be used in connection with execution of the query plan, the query metadata is obtained based at least in part on the snapshot of the metadata associated with the catalog server session, and the query metadata is communicated to the worker node contemporaneous with respect to the query plan;
- in response to receiving the query plan and the query metadata, determining, by the worker node, that additional metadata is required for the worker node to execute the query plan;
- in response to determining that additional metadata is required, requesting, by the worker node, the additional metadata, wherein the worker node queries a parent in a tree structure of a plurality of worker nodes in a parallel processing database system for the additional metadata, and the parent node is a node between the master node and the worker node in relation to the tree structure;
- receiving the additional metadata from another worker node, wherein the additional metadata is retrieved from a same session as the catalog server session corresponding to the query;
- executing the query plan on the worker node;
- and
- returning, to the master node, a result associated with the execution of the query plan on the worker node.
A system for executing queries in a parallel processing database, comprising a non-transitory computer readable medium and a processor configured to:
- receive a query at a master node, the master node having access to a database catalog that comprises metadata defining database objects;
- in response to receiving the query, initiate a catalog server session, taking a snapshot of the metadata, and associating the snapshot of the metadata with the catalog server session, wherein a separate catalog server session is initiated and a separate snapshot of the metadata is taken for a separate query that is not the same as the query received at the master node;
- communicate a query plan and query metadata to a worker node, wherein the query plan is generated based at least in part on the query, the query metadata includes metadata to be used in connection with execution of the query plan, the query metadata is obtained based at least in part on the snapshot of the metadata associated with the catalog server session, and the query metadata is communicated to the worker node contemporaneous with respect to the query plan;
- in response to receiving the query plan and the query metadata, determining, by the worker node, that additional metadata is required for the worker node to execute the query plan;
- in response to determining that additional metadata is required, requesting, by the worker node, the additional metadata, wherein the worker node queries a parent in a tree structure of a plurality of worker nodes in a parallel processing database system for the additional metadata, and the parent node is a node between the master node and the worker node in relation to the tree structure;
- receiving the additional metadata from another worker node, wherein the additional metadata is retrieved from a same session as the catalog server session corresponding to the query;
- executing the query plan on the worker node;
- and
- returning, to the master node, a result associated with the execution of the query plan on the worker node.
Dependencies are inferred from the claim text.