CN116628017A - Federal query method for database cluster and machine-readable storage medium - Google Patents

Federal query method for database cluster and machine-readable storage medium Download PDF

Info

Publication number
CN116628017A
CN116628017A CN202310632697.3A CN202310632697A CN116628017A CN 116628017 A CN116628017 A CN 116628017A CN 202310632697 A CN202310632697 A CN 202310632697A CN 116628017 A CN116628017 A CN 116628017A
Authority
CN
China
Prior art keywords
local
computing node
node
foreign
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310632697.3A
Other languages
Chinese (zh)
Inventor
王鸿翔
冷建全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202310632697.3A priority Critical patent/CN116628017A/en
Publication of CN116628017A publication Critical patent/CN116628017A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of distributed database management, in particular to a federal query method of a database cluster and a machine-readable storage medium, wherein the method comprises the following steps: when a local main node acquires a connection query instruction, the local main node generates a corresponding distributed execution plan according to the connection query instruction, acquires information of a foreign computing node, and sends the distributed execution plan and the information to the local computing node; the local computing node is connected with the foreign computing node according to the information, acquires internal table data from a local database cluster according to the distributed execution plan, and acquires external table data from the foreign computing node. According to the technical scheme, the data transmission quantity of the main node of the database cluster during federation inquiry can be reduced, and the aim of improving the inquiry efficiency of federation inquiry is fulfilled.

Description

Federal query method for database cluster and machine-readable storage medium
Technical Field
The present application relates to the field of distributed database management technologies, and in particular, to a federal query method and a machine-readable storage medium for a database cluster.
Background
With the development of the information age, more and more digital information is generated in each industry, and more data needs to be stored at the same time. The shared-nothing distributed database is widely applied to various industries because of great advantages in storing a large amount of data, and the data storage of different application services is stored by adopting different distributed database clusters. With the development of services, some application services also need data of other services for statistical analysis, which results in a distributed database cluster needing to obtain data in other distributed clusters. At present, a common method for acquiring data across databases is to synchronize needed data from other clusters to a local distributed cluster through tools such as etl and the like, and then perform data analysis on the local distributed cluster, but the method can cause data redundancy and disk waste, and meanwhile, the method can also need to update the data in real time so as to bring more writing disk pressure to influence the data storage of the database cluster.
In order to solve the data redundancy problem, a federal query or other manners may be used to perform a cross-database query, that is, a manner of accessing a remote table is used, when the local database cluster needs data in a foreign database cluster when performing the query, the remote table may be accessed through a protocol, and then the remote table data is sent to the local database cluster. The conventional technology of federal query at present has external table access, dblink and other modes for performing cross-database query, and the method omits a plurality of data synchronization operations and disk space, but basically is based on query execution and data transmission among main nodes of a database cluster, and under the condition of more query data, the main nodes have data transmission bottlenecks and even query execution bottlenecks, so that the data query efficiency of the database cluster is reduced.
Disclosure of Invention
In view of the foregoing, the present application has been made to provide a federal query method and a machine-readable storage medium for a database cluster that overcome or at least partially solve the foregoing problems, and can reduce the data transmission amount of a master node of the database cluster during federal query, thereby achieving the purpose of improving the query efficiency of federal query.
In order to solve at least the above technical problems, the present application provides a federal query method for a database cluster, including:
when a local main node acquires a connection query instruction, the local main node generates a corresponding distributed execution plan according to the connection query instruction, acquires information of a foreign computing node, and sends the distributed execution plan and the information to the local computing node;
the local computing node is connected with the foreign computing node according to the information, acquires internal table data from a local database cluster according to the distributed execution plan, and acquires external table data from the foreign computing node.
According to one embodiment of the present application, after obtaining internal table data from the local database cluster and external table data from the foreign computing node according to the distributed execution plan, the method further comprises:
the local computing node calculates the internal table data and the external table data to obtain corresponding computing results, and sends the computing results to the local master node; and
and the local main node gathers the calculation results and returns the calculation results to the client.
According to one embodiment of the present application, before the local master node obtains the connection query instruction, the method further includes:
creating an external table of parallel scanning, and mapping cluster information of a foreign database cluster to the external table; and
the join query instruction is a query instruction involving the external table.
According to one embodiment of the application, the cluster information includes host information, port information, database information, namespaces, data table names, user information, and user passwords of the foreign database cluster.
According to one embodiment of the application, the local computing node closes the connection with the foreign computing node when the local computing node has fully acquired the external table data.
According to one embodiment of the present application, the local master node generates a corresponding distributed execution plan according to the connection query instruction, including:
and the local main node performs query analysis and optimization on the connection query instruction to generate the distributed execution plan.
According to one embodiment of the present application, the obtaining information of the foreign computing node includes:
and the local master node is connected with the foreign master node according to the connection query instruction so as to acquire the information of the foreign computing node from the foreign master node.
According to one embodiment of the application, the information of the local computing node is sent to the foreign master node when the local master node is connected by the foreign master node.
According to one embodiment of the present application, when the local computing node is connected by the foreign computing node, the local computing node performs external table scanning of the foreign computing node and transmits scanning data to the foreign computing node.
In another aspect, the present application also provides a machine-readable storage medium having stored thereon a machine-executable program which when executed by a processor implements a federal query method according to any of the above embodiments.
According to the federation query method between database clusters, when a local master node acquires a connection query instruction, the local master node generates a corresponding distributed execution plan according to the connection query instruction, acquires information of a foreign computing node, and sends the distributed execution plan and the information of the foreign computing node to the local computing node; and then the local computing node is connected with the external computing node according to the information of the external computing node, and the internal table data are acquired from the local database cluster and the external table data are acquired from the external computing node according to the distributed execution plan. In the technical scheme of the application, the local computing node of the local database cluster directly acquires the external table data from the external computing node of the external database cluster, and the local host node is not required to receive the external table data from the external host node, so that the data transmission quantity between the local host node and the external host node can be reduced, the bottleneck of data transmission and the bottleneck of data query execution caused by the overlarge data transmission quantity between the local host node and the external host node can be avoided, and the aim of improving the data query efficiency of federal query can be fulfilled.
The above, as well as additional objectives, advantages, and features of the present application will become apparent to those skilled in the art from the following detailed description of a specific embodiment of the present application when read in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the application will be described in detail hereinafter by way of example and not by way of limitation with reference to the accompanying drawings. The same reference numbers will be used throughout the drawings to refer to the same or like parts or portions. It will be appreciated by those skilled in the art that the drawings are not necessarily drawn to scale. In the accompanying drawings:
FIG. 1 is a schematic flow chart diagram of a federal query method for a database cluster in accordance with one embodiment of the application;
FIG. 2 is a schematic diagram of a machine-readable storage medium according to one embodiment of the application.
Detailed Description
A federal query method and machine-readable storage medium for database clusters in accordance with embodiments of the present application are described below with reference to fig. 1-2. In the description of the present embodiment, it should be understood that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature, i.e. one or more such features. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise. When a feature "comprises or includes" a feature or some of its coverage, this indicates that other features are not excluded and may further include other features, unless expressly stated otherwise.
In the description of the present embodiment, a description referring to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the following description, the federal query method of database clusters of the present application relates to a plurality of database clusters, and each database cluster has a corresponding master node and a computing node, where the master node is configured to generate a corresponding execution plan according to a query instruction of a client and send the execution plan to a computing node at a lower layer, and the computing node is configured to perform a data query according to the execution plan. When describing the federation query method of the database cluster of the present application, the master node and the computing node in the local database cluster are respectively referred to as a local master node and a local computing node, and other database clusters are referred to as foreign database clusters, and the master node and the computing node in the foreign database cluster are respectively referred to as a foreign master node and a foreign computing node.
Referring to fig. 1, fig. 1 shows a flowchart of a federal query method of a database cluster, where the federal query method is used for federally querying a plurality of database clusters, and a local computing node obtains external table scan data during query, so as to solve the bottleneck problem of local master node data transmission, and achieve the purpose of improving the query efficiency of federal query. The federal query method of the present application is described in detail below in conjunction with the flow chart shown in fig. 1.
As shown in fig. 1, the federation query method of the database cluster of the present application includes the steps of:
step S1: when the local main node acquires the connection query instruction, the local main node generates a corresponding distributed execution plan according to the connection query instruction and acquires information of the foreign computing node.
In this embodiment, when a user performs a data query to a local database cluster through a client, a query command is sent to a local master node, and if the query command relates to a foreign database cluster, the query command is a connection query command, that is, the connection query command is a query command related to both an internal table and an external table.
Because the connection query instruction received by the local master node relates to the foreign database cluster, federal query needs to be performed on the local database cluster and the foreign database cluster to acquire corresponding data. When the local master node generates a corresponding distributed execution plan according to the connection query, the local master node not only relates to the data query of the local database cluster, but also relates to the data query of the external database cluster, and in order to facilitate the query of the external database cluster, the information of the external computing node is also acquired. The foreign computing node refers to a computing node of a foreign database cluster related to the connection query instruction, and the information of the foreign computing node at least includes information required for establishing a communication connection with the foreign computing node, such as an ip address, a port, and the like of the foreign computing node.
Step S2: and the local master node sends the generated distributed execution plan and information of the foreign computing node to the local computing node.
In this embodiment, the local computing node refers to a lower computing node in the local database cluster, and the computing node is communicatively connected to the local host node. And after the local master node generates a corresponding distributed execution plan according to the connection query instruction and acquires information of the external computing node, the distributed execution plan and the information of the external computing node are transmitted to the local computing node through communication connection with the local computing node.
Step S3: the local computing node is connected with the external computing node according to the information of the external computing node, acquires the internal table data according to the distributed execution plan, and acquires the external table data from the external computing node.
The internal table data refers to data in a local database cluster to be queried in the connection query instruction, and the external table data refers to data in a foreign database cluster to be queried in the connection query instruction. After the local computing node establishes connection with the foreign node according to the information of the foreign computing node, data interaction can be performed with the foreign computing node. Because the distributed execution plan relates to data query of the local database cluster and data query of the external database cluster at the same time, the local computing node can query the local database cluster according to the distributed execution plan to obtain internal table data and interact with the external computing node according to the distributed execution plan to execute external table scanning, for example, the local computing node can send a query statement of the distributed execution plan, which needs to query the external database cluster, to the external computing node, and the external computing node can query data according to the query statement to obtain external table data and send the external table data to the local computing node, so that the local computing node can directly obtain the external table data from the external computing node.
In summary, in the federation query method between database clusters in this embodiment, when a local master node obtains a connection query instruction, the local master node generates a corresponding distributed execution plan according to the connection query instruction and obtains information of a foreign computing node, and sends the distributed execution plan and the information of the foreign computing node to the local computing node; and then the local computing node is connected with the external computing node according to the information of the external computing node, and the internal table data are acquired from the local database cluster and the external table data are acquired from the external computing node according to the distributed execution plan. In this embodiment, the local computing node of the local database cluster directly obtains the external table data from the external computing node of the external database cluster, and the local host node is not required to receive the external table data from the external host node, so that the data transmission amount between the local host node and the external host node can be reduced, and the bottleneck of data transmission and the bottleneck of data query execution caused by the overlarge data transmission amount between the local host node and the external host node are reduced or even avoided, and the aim of improving the data query efficiency of federal query can be achieved.
In one embodiment of the present application, the federal query method of a database cluster of the present application further includes:
after the local computing node acquires internal table data from the local database cluster and external table data from the external computing node according to the distributed execution plan, computing the internal table data and the external table data to obtain corresponding computing results, and transmitting the computing results to the local master node;
and after the local master node receives the calculation result of the local calculation node, the calculation result is converged and returned to the client.
In this embodiment, the distributed execution plan generated by the local master node includes not only the internal table data and the external table data that need to be queried, but also a calculation expression for calculating each of the internal table data and the external table data. After the local computing node obtains the internal table data and the external table data, the internal table data and the external table data can be connected, corresponding computation is performed by adopting a computing expression, so as to obtain a computing result, and then the computing result is sent to the local master node. Because there may be multiple local computing nodes in the local database cluster, the local master node may obtain multiple computing results, and the multiple computing results are all data information that the user needs to query, so the local master node aggregates the computing results of the local computing nodes and sends the computing results to the client of the user, so that the user can obtain the expected query result.
In the setting manner of this embodiment, the local master node aggregates the calculation results of the local calculation nodes and returns the calculation results to the client, so that, compared with other embodiments (for example, the local master node directly returns the calculation results of the local calculation nodes to the client without aggregating the calculation results of the local calculation nodes), the loss of query data can be avoided. In addition, the setting mode of the embodiment only needs to perform information interaction between the local master node and the client, so that the reliability of the database cluster can be further improved.
In one embodiment of the present application, the federal query method of a database cluster of the present application further includes:
before a local main node acquires a connection query instruction, an external table of parallel scanning is firstly established, and cluster information of a local database cluster is mapped into the established external table; and
the connection query instruction obtained by the local master node in step S1 is a query instruction including the external table.
In this embodiment, an external table of parallel scanning is created, and cluster information of a foreign database cluster is mapped into the external table, so that the local database cluster can obtain the information of the foreign database cluster, so that the local database cluster and the foreign database cluster can be connected conveniently.
When executing the step S1, the local master node may first determine whether a query instruction sent by the client is received; if yes, further judging whether the query instruction carries the created external table; if the local database cluster is provided with the query instruction, the local database cluster can perform federal query with the corresponding foreign database cluster according to the query instruction, so that the query instruction is judged to be a connection query instruction. Otherwise, if the query instruction received by the local master node does not have the created external table, the received query instruction may be considered to not involve the query of external table data, or the local master node may not be able to establish a connection with the external database cluster to which the query instruction relates, i.e. no federal query is required or cannot be performed, so that it is determined that the query instruction is not a connection query instruction.
By the setting mode of the embodiment, the local database cluster can acquire the external table with the external database cluster, and the local main node can judge whether the received query instruction is a connection query instruction according to the external table, so as to judge whether federal query is needed. Therefore, the setting mode of the embodiment can improve the reliability of federal query of the database cluster.
In one embodiment of the application, when mapping cluster information of a foreign database cluster to a created external table, the mapped cluster information includes host information, port information, database information, namespaces, data table names, user information, and user passwords of the foreign database cluster.
In this embodiment, the host information and the port information of the foreign database cluster in the mapping information may provide necessary conditions for establishing connection between the local database cluster and the foreign database cluster; the user information and the user password can prevent the illegal database cluster from establishing connection with the foreign database cluster, and ensure the security of the connection between the local database cluster and the foreign database cluster; database information, namespaces, and data table names may provide support for scanning of external table data. Therefore, the setting mode of the embodiment can improve the safety and reliability of federal query between the local database cluster and the foreign database cluster.
In one embodiment of the present application, the federal query method of a database cluster of the present application further includes:
after the local computing node completely acquires the external table data from the foreign computing node, the connection with the foreign computing node is closed.
In this embodiment, after the local computing node completely acquires the external table data from the external computing node, the local computing node is invalidated and performs information interaction with the external computing node, if the connection with the external computing node is continuously maintained, on one hand, resources of the local computing node and the external computing node are occupied, and on the other hand, the local computing node may generate useless data interaction with the external computing node, so that accuracy of the external table data is affected. For example, when a local computing node or a foreign computing node transmits broadcast data, the foreign computing node or the local computing node may receive data unrelated to the external table data. Therefore, in this embodiment, when the local computing node completely acquires the external table data from the external computing node, the connection between the local computing node and the external computing node is closed, so that not only can the resource waste of the local computing node and the external computing node be reduced, but also the accuracy of the obtained external table data can be ensured.
In one embodiment of the present application, the local master node generates a distributed execution plan according to a connection query instruction, including:
and the local main node performs query analysis and optimization on the received connection query instruction to generate a corresponding distributed execution plan.
In this embodiment, an optimizer may be employed to query and optimize the connection query instructions, and the query and optimization of the connection query instructions by the local host node may include, but is not limited to: analyzing the connection query instruction to obtain redundant query sentences in the connection query instruction, and deleting the redundant query sentences; analyzing and deleting query sentences which do not accord with the database cluster query rules in the connection query instruction; analyzing to obtain the execution sequence of the query sentences in the connection query instruction; classifying query sentences in the connection query instructions and the like.
According to the setting mode of the embodiment, the local main node generates the corresponding distributed execution plan by carrying out query analysis and optimization on the connection query instruction, so that the simplicity and the accuracy of the distributed execution plan can be improved, and the execution efficiency and the accuracy of federal query are improved.
In one embodiment of the present application, the local master node obtains information of a foreign computing node, including:
firstly, a local master node is connected with a corresponding foreign master node according to a connection query instruction;
the local master node then obtains information of the corresponding foreign computing node from the connected foreign master node.
In this embodiment, since the connection query information received by the local master node relates to a foreign database cluster to be connected, the local master node may obtain information of the related foreign database cluster according to the connection query information, and the information of the foreign database cluster includes information of a master node in the foreign database cluster, that is, information of the foreign master node; then, the local master node may establish a connection with the foreign master node according to the information of the foreign master node, and acquire information of the foreign computing node from the foreign master node.
In the setting mode of the embodiment, the local master node acquires the information of the external computing node by connecting with the external master node, so that the information of the external master node is only required to be stored on the local master node, the information of the external computing node is not required to be stored on the local master node, and the data storage capacity on the local master node can be reduced. When the computing nodes in the external database cluster are changed, for example, when the original computing nodes in the external database cluster are abnormal and other nodes are set to be new computing nodes, the local master node can accurately obtain the information of the external computing nodes from the external master node, so that the reliability of the connection of the local computing nodes to the external computing nodes is improved.
In one embodiment of the present application, the federal query method of a database cluster of the present application further includes:
when the local master node is connected by the foreign master node, the local master node transmits information of the local computing node to the foreign master node.
In this embodiment, if the user accesses a foreign database cluster through the client, the local database cluster needs to interact with the foreign database, so that the foreign database cluster can return a desired query result to the client. When the local database cluster and the local database cluster perform federal query, the local master node is connected with the local master node to acquire information of the local computing node. Thus, in response to federation queries of the foreign database cluster, when the local master node is connected by the foreign master node, information of the local computing node is sent to the foreign master node so that the foreign computing node is connected with the local computing node and performs federation queries.
Due to the arrangement mode of the embodiment, the local database cluster and the external database cluster can be matched to perform federation query, so that the flexibility and the universality of a federation query method of the database cluster can be improved.
In one embodiment of the present application, the federal query method of a database cluster of the present application further includes:
when the local computing node is connected by the foreign computing node, the local computing node performs external table scanning of the foreign computing node and transmits scanning data to the foreign computing node.
The setting manner of the embodiment is to respond to federation query of a foreign database cluster, when a local computing node is connected by a foreign computing node, the local computing node executes external table scanning of the foreign computing node to obtain corresponding scanning data, and sends the scanning data to the foreign computing node, so that the foreign computing node obtains the corresponding external table scanning data to realize federation query. Due to the arrangement mode of the embodiment, the local database cluster and the external database cluster can be matched to perform federation query, so that the flexibility and the universality of a federation query method of the database cluster can be improved.
The present embodiment also provides a machine-readable storage medium and a computer device. Fig. 2 is a schematic diagram of a machine-readable storage medium 20 according to one embodiment of the application, the machine-readable storage medium 20 having stored thereon a machine-executable program 21, the machine-executable program 21, when executed by a processor, implementing the federal query method for a database cluster of any of the embodiments described above.
It should be noted that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any machine-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
For the purposes of this description of embodiments, a machine-readable storage medium 20 can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the machine-readable storage medium 20 include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the machine-readable storage medium 20 may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
The flowcharts provided by this embodiment are not intended to indicate that the operations of the method are to be performed in any particular order, or that all of the operations of the method are included in all of each case. Furthermore, the above-described method may include additional operations. Additional variations may be made to the above-described methods within the scope of the technical ideas provided by the methods of the present embodiments.
By now it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the application have been shown and described herein in detail, many other variations or modifications of the application consistent with the principles of the application may be directly ascertained or inferred from the present disclosure without departing from the spirit and scope of the application. Accordingly, the scope of the present application should be understood and deemed to cover all such other variations or modifications.

Claims (10)

1. A federal query method of a database cluster, comprising:
when a local main node acquires a connection query instruction, the local main node generates a corresponding distributed execution plan according to the connection query instruction, acquires information of a foreign computing node, and sends the distributed execution plan and the information to the local computing node;
the local computing node is connected with the foreign computing node according to the information, acquires internal table data from a local database cluster according to the distributed execution plan, and acquires external table data from the foreign computing node.
2. The federal query method according to claim 1, wherein,
after obtaining the internal table data from the local database cluster and the external table data from the foreign computing node according to the distributed execution plan, further comprising:
the local computing node calculates the internal table data and the external table data to obtain corresponding computing results, and sends the computing results to the local master node; and
and the local main node gathers the calculation results and returns the calculation results to the client.
3. The federal query method according to claim 1, wherein,
before the local master node obtains the connection query instruction, the method further comprises:
creating an external table of parallel scanning, and mapping cluster information of a foreign database cluster to the external table; and
the join query instruction is a query instruction involving the external table.
4. The federal query method according to claim 3, wherein,
the cluster information comprises host information, port information, database information, namespaces, data table names, user information and user passwords of the foreign database cluster.
5. The federal query method according to claim 1, wherein,
and when the local computing node completely acquires the external table data, the local computing node closes the connection with the external computing node.
6. The federal query method according to claim 1, wherein,
the local master node generates a corresponding distributed execution plan according to the connection query instruction, and the distributed execution plan comprises:
and the local main node performs query analysis and optimization on the connection query instruction to generate the distributed execution plan.
7. The federal query method according to claim 1, wherein,
the obtaining information of the external computing node comprises the following steps:
and the local master node is connected with the foreign master node according to the connection query instruction so as to acquire the information of the foreign computing node from the foreign master node.
8. The federal query method according to claim 7, wherein,
and when the local master node is connected by the foreign master node, transmitting the information of the local computing node to the foreign master node.
9. The federal query method according to claim 1, wherein,
when the local computing node is connected by the foreign computing node, the local computing node performs external table scanning of the external computing node and transmits scanning data to the foreign computing node.
10. A machine-readable storage medium having stored thereon a machine-executable program which when executed by a processor implements the federal query method of any of claims 1 to 9.
CN202310632697.3A 2023-05-30 2023-05-30 Federal query method for database cluster and machine-readable storage medium Pending CN116628017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310632697.3A CN116628017A (en) 2023-05-30 2023-05-30 Federal query method for database cluster and machine-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310632697.3A CN116628017A (en) 2023-05-30 2023-05-30 Federal query method for database cluster and machine-readable storage medium

Publications (1)

Publication Number Publication Date
CN116628017A true CN116628017A (en) 2023-08-22

Family

ID=87616824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310632697.3A Pending CN116628017A (en) 2023-05-30 2023-05-30 Federal query method for database cluster and machine-readable storage medium

Country Status (1)

Country Link
CN (1) CN116628017A (en)

Similar Documents

Publication Publication Date Title
US9244958B1 (en) Detecting and reconciling system resource metadata anomolies in a distributed storage system
CN110502507B (en) Management system, method, equipment and storage medium of distributed database
US7693816B2 (en) Computer system, computer, data access method and database system
CN110046133B (en) Metadata management method, device and system for storage file system
US7165083B2 (en) File management method in a distributed storage system
JP6492123B2 (en) Distributed caching and cache analysis
US10831612B2 (en) Primary node-standby node data transmission method, control node, and database system
US8266273B2 (en) Realtime process history server
US11550646B2 (en) Method of verifying access of multi-core interconnect to level-2 cache
CN106844676B (en) Data storage method and device
US9514170B1 (en) Priority queue using two differently-indexed single-index tables
US11500755B1 (en) Database performance degradation detection and prevention
US11082494B2 (en) Cross storage protocol access response for object data stores
CN114356921A (en) Data processing method, device, server and storage medium
US9380127B2 (en) Distributed caching and cache analysis
CN108924215B (en) Service discovery processing method and device based on tree structure
US8380806B2 (en) System and method for absolute path discovery by a storage virtualization system
CN109783462A (en) A kind of data access method and device based on distributed file system
US8548980B2 (en) Accelerating queries based on exact knowledge of specific rows satisfying local conditions
CN113032356A (en) Cabin distributed file storage system and implementation method
CN116628017A (en) Federal query method for database cluster and machine-readable storage medium
JP2007287180A (en) Distributed file system, distributed file system server, and method for accessing distributed file system
TWI544342B (en) Method and system for verifing quality of server
US7596588B2 (en) Managing files to be offloaded by multiple users into a common storage repository
CN111221857B (en) Method and apparatus for reading data records from a distributed system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination