Distributed database query method and device
A query method and a query device technology, applied in the database field, can solve problems such as low execution efficiency and slow speed, and achieve the effects of reducing pressure, reducing data movement, and shortening the time consumed by aggregation
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035] An embodiment of the present disclosure provides a query method for a distributed database, where the distributed database includes a master node and multiple computing nodes connected to the master node. refer to figure 1 The flow chart of the query method of the distributed database shown in this method is applied to the computing node, and may include the following steps:
[0036] Step S102, receiving a query plan containing multi-stage aggregation operations sent by the master node; wherein, the query plan is generated by the master node based on the query request of the client;
[0037] Step S104, in the process of executing the query plan, obtain the original data to be aggregated, and perform a multi-stage aggregation operation on the original data to obtain the target aggregated data; wherein, the multi-stage aggregation operation means performing at least one aggregation operation on the original data;
[0038] Step S106, sending the target aggregation data to...
Embodiment 2
[0057] In another embodiment, a method for querying a distributed database is also provided. The database includes a master node and a plurality of computing nodes connected to the master node. The method is applied to the master node and may include the following steps:
[0058] Step 1, generate a query plan containing multi-stage aggregation operations based on the received query request from the client;
[0059] Step 2: Send the query plan to each computing node, so that each computing node obtains the original data to be aggregated during the execution of the query plan, and performs multi-stage aggregation operations on the original data to obtain the target aggregated data; among them, A multi-stage aggregation operation means performing at least one aggregation operation on the original data;
[0060] Step 3: Receive the target aggregation data sent by each computing node, and obtain query results based on each target aggregation data.
[0061] In the query method of t...
Embodiment 3
[0069] refer to Figure 5As shown in the flow chart of another distributed database query method, the distributed database query method provided by the embodiment of the present disclosure mainly includes the following steps:
[0070] Step 1), the client sends a SQL request to the distributed database.
[0071] Step 2), performing lexical analysis and syntax analysis on the SQL request to generate a syntax tree.
[0072] Step 3), preprocessing the syntax tree to determine whether to distribute the syntax tree; if yes, then perform the following step 4); if not, then execute utility commands, such as DDL, etc.
[0073] Step 4), perform semantic analysis and query rewriting (such as selection, insertion, update, deletion) on the syntax tree to generate a query tree.
[0074] Step 5), the optimizer processes the query tree to generate a query plan containing multi-stage aggregation operations.
[0075] Step 6), the executor of the computing node executes the query plan to retu...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


