CN109117426B - Distributed database query method, device, equipment and storage medium - Google Patents

Distributed database query method, device, equipment and storage medium Download PDF

Info

Publication number
CN109117426B
CN109117426B CN201710484200.2A CN201710484200A CN109117426B CN 109117426 B CN109117426 B CN 109117426B CN 201710484200 A CN201710484200 A CN 201710484200A CN 109117426 B CN109117426 B CN 109117426B
Authority
CN
China
Prior art keywords
query
query statement
data storage
merging
copy
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.)
Active
Application number
CN201710484200.2A
Other languages
Chinese (zh)
Other versions
CN109117426A (en
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.)
Jinzhuan Xinke Co Ltd
Original Assignee
Jinzhuan Xinke 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 Jinzhuan Xinke Co Ltd filed Critical Jinzhuan Xinke Co Ltd
Priority to CN201710484200.2A priority Critical patent/CN109117426B/en
Publication of CN109117426A publication Critical patent/CN109117426A/en
Application granted granted Critical
Publication of CN109117426B publication Critical patent/CN109117426B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a distributed database query method, a device, equipment and a storage medium, which are used for receiving query sentences, wherein the query sentences comprise target data tables, and the target data tables are data tables of databases to be queried in the query sentences; when the target data table comprises more than two, analyzing and determining whether the query statement accords with a merging condition; and when the query statement accords with the merging condition, merging the query statement according to a merging rule corresponding to the merging condition, and issuing the merged query statement to a corresponding data storage node for processing. The combined query sentences are issued to the corresponding fewer data storage nodes for processing, so that the number of the data storage nodes required to be processed is reduced, the processing of the distributed database agent is reduced, the burden of the distributed database agent is lightened, and the execution speed can be improved, therefore, the query efficiency is high.

Description

Distributed database query method, device, equipment and storage medium
Technical Field
The present invention relates to the field of information retrieval, and in particular, to a distributed database query method, a distributed database query device, a distributed database query computer device, and a distributed database storage medium.
Background
A distributed database (in english, distributed Database, DDB for short) is a database in which data is stored on each computer in a computer network, which may be referred to as a data storage node.
In the traditional distributed database query technology, particularly under the conditions of multiple tables and multiple data storage nodes, the query processing is required to be carried out on each data node of the data table in the query statement due to the introduction of a distributed query management system, so that the problems of overlarge input/output interfaces of the data storage nodes and overlarge network transmission data amount are caused, and the query efficiency is low.
Disclosure of Invention
Based on this, it is necessary to provide a distributed database query method, device, equipment and storage medium with high query efficiency, aiming at the problem of low query efficiency of the traditional distributed database.
A distributed database query method, comprising:
receiving a query statement, wherein the query statement comprises a target data table, and the target data table is a data table of a database to be queried in the query statement;
when the target data table comprises more than two, analyzing and determining whether the query statement accords with a merging condition;
and when the query statement accords with the merging condition, merging the query statement according to a merging rule corresponding to the merging condition, and issuing the merged query statement to a corresponding data storage node for processing.
A distributed database querying device, comprising:
the query statement receiving module is used for receiving a query statement, wherein the query statement comprises a target data table, and the target data table is a data table of a database to be queried in the query statement;
the query statement analysis module is used for analyzing and determining whether the query statement accords with the merging condition when the target data table comprises more than two target data tables;
and the statement merging and issuing module is used for merging the query statement according to the merging rule corresponding to the merging condition when the query statement accords with the merging condition, and issuing the merged query statement to the corresponding data storage node for processing.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the distributed database query method described above when the computer program is executed by the processor.
A computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of the distributed database querying method described above.
According to the method, the device, the equipment and the storage medium, the combined query sentences are issued to the corresponding fewer data storage nodes for processing, so that the number of the data storage nodes required to be processed is reduced, the processing of the distributed database agent is reduced, the burden of the distributed database agent is lightened, the execution speed can be improved, and the query efficiency is high.
Drawings
FIG. 1 is a schematic diagram of an application environment of a distributed database query method and apparatus according to an embodiment;
FIG. 2 is a flow chart of a distributed database query method according to an embodiment;
FIG. 3 is a flow chart of a distributed database query method according to another embodiment;
FIG. 4 is a specific flow chart of one step of the distributed database query method of FIG. 2 or FIG. 3;
FIG. 5 is a diagram comparing a conventional query process with the query process of the present invention;
FIG. 6 is a block diagram of a distributed database querying device according to an embodiment;
FIG. 7 is a block diagram of a distributed database querying device according to another embodiment;
fig. 8 is a specific structural view of one module of the distributed database query apparatus of fig. 6 or 7.
Detailed Description
In order that the invention may be readily understood, a more complete description of the invention will be rendered by reference to the appended drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "or/and" as used herein includes any and all combinations of one or more of the associated listed items.
Fig. 1 is a schematic diagram of an application environment of a distributed database query method and apparatus according to an embodiment. As shown in fig. 1, the application environment includes a client terminal, a distributed database proxy, and at least two data storage nodes. The client terminal sends a query statement to the distributed database proxy over the network. The distributed database agent receives the query statement and performs distributed database query on the query statement. The data storage nodes are connected with the distributed database through a network. The distributed database query method and the device provided by the invention are operated on the distributed database proxy, and the distributed database proxy can be a server. The distributed database agent is responsible for establishing connection with the client terminal, receiving query request sentences of the client terminal, analyzing the received query sentences, determining data storage nodes which need to be accessed by using a merging rule under the condition of meeting merging conditions, and carrying out merging and issuing execution of the query sentences.
Referring to fig. 2, an embodiment of the present invention provides a distributed database query method, including:
s210: and receiving a query statement, wherein the query statement comprises a target data table, and the target data table is a data table of a database to be queried in the query statement.
When the client terminal needs to query the database, a query request is sent to the distributed data agent, wherein the query request comprises a query statement. The distributed data agent in which the method operates receives the query statement in a manner of receiving the query request, thereby receiving the query statement.
The query statement may be a conventional query statement or a complex query statement. Wherein, the conventional query sentence is a query sentence including only one basic query sentence; the complex query statement is a query statement comprising at least two basic query statements, and the basic query statements in the complex query statement can be divided into a main query statement and a sub-query statement according to the structure of the complex query statement.
It should be noted that, for a complex query statement, the target data table includes the data tables of the databases to be queried in the main query statement and the sub query statement. That is, merging between a main query statement and a sub-query statement needs to be considered for a complex query statement, for example, for a complex query statement that contains from sub-query statement and where sub-query statement.
S240: when the target data table includes more than two, analysis determines whether the query statement meets the merge condition.
When the target data table does not comprise more than two, namely, the target data table only comprises a single data table, directly pressing down according to the query statement, namely, issuing the query statement to one data storage node corresponding to the target data table for execution.
When the target data table includes more than two, analysis determines whether the query statement meets the merge condition.
The merge condition is a condition in which sentences representing accesses to the data storage nodes of the target databases are merged into sentences representing accesses to the necessary data storage nodes of the target data tables. For a query statement that meets the merge condition, the number of data storage nodes that it must have is less than the number of data storage nodes for its respective target data table.
When the query sentence meets the merge condition, step S250 is executed.
S250: and merging the query sentences according to the merging rules corresponding to the merging conditions, and issuing the merged query sentences to the corresponding data storage nodes for processing.
The merge rule corresponds to a merge condition, and is a rule for merging a statement indicating an access to each data storage node of each target database into a statement indicating an access to a data storage node necessary for each target data table. When the query statement accords with the merging condition, merging the query statement according to the merging rule, and issuing the merged query statement to a data storage node corresponding to the merged query statement for processing.
According to the method, the query statement accords with the merging condition, the merging processing is carried out according to the merging rule corresponding to the merging condition, all data storage nodes of all target data tables are not required to be accessed, only the necessary data storage nodes are required to be accessed, and the number of the data storage nodes corresponding to the merged data storage nodes is smaller than that of the data storage nodes before merging. Therefore, the combined query statement can be issued to the corresponding data storage node for processing, and the query result which is the same as the processing of more data storage nodes corresponding to the query statement before combination is obtained. Meanwhile, because the combined query sentences are issued to the corresponding fewer data storage nodes for processing, the number of the data storage nodes needing to be processed is reduced, the processing of the distributed database agent is reduced, the burden of the distributed database agent is lightened, and the execution speed can be improved, so that the query efficiency is high.
It will be appreciated that after step S250, it may further include: and receiving a processing result returned by the data storage node. Thus, the distributed database agent can further return the processing result to the client terminal as a query result corresponding to the query statement.
Referring to fig. 3, in one embodiment, the method further includes: when the query sentence does not meet the merge condition, steps S260 to S290 are performed. I.e. after step S240, further comprising: when the query sentence does not meet the merge condition, steps S260 to S290 are performed.
S260: splitting the query statement into simple statements conforming to the merging condition.
When the query statement does not meet the merging condition, the query statement is split into simple statements meeting the merging condition.
S270: and merging the simple sentences according to the merging rules, and issuing each merged simple sentence to a corresponding data storage node for processing.
S280: and receiving processing results returned by each data storage node, wherein the processing results are query results corresponding to the combined simple sentences.
S290: and carrying out query operation on the processing result according to the query statement to obtain a query result corresponding to the query statement.
The query operation corresponds to a splitting manner employed when splitting the query statement. Thus, the query result corresponding to the query statement can be obtained.
It should be noted that, although the simple sentences obtained after splitting cannot be combined before splitting the query sentences, the number of data storage nodes required to execute processing is reduced as a whole, so that the query efficiency of the query sentences can be improved.
In one embodiment, in step S280, the processing result returned by each received data storage node may be cached; at this time, step S290 is to perform a query operation on the processing result in the cache according to the query statement, so as to obtain a query result corresponding to the query statement. Thereby further improving the processing speed and the query efficiency of the query statement.
Referring to fig. 4, in one embodiment, the step of analyzing and determining whether the query sentence meets the merge condition, i.e. step S240, includes:
s241: if each target data table is a copy table and the data storage nodes of each copy table have intersections, the query statement accords with the merging condition;
or/and the like,
s243: if the target data table comprises a non-copy table and at least one copy table, and the intersection of the data storage nodes of each copy table covers the data storage nodes of the non-copy table, the query statement accords with the merging condition.
Overlaying refers to overlaying objects including all objects of the overlaid object. For example, assume that the data storage nodes corresponding to the copy table a are 1,2,3, and 4, the intersections of the data storage nodes corresponding to the copy table b are 1,2,3, and 5, and the data storage nodes corresponding to the non-copy table c are 2 and 3. The overlay object (intersection of data storage nodes corresponding to copy tables a, b is 1,2, 3) includes the overlay object (data storage nodes corresponding to non-copy table c is 2, 3), and the data storage nodes 1,2,3 include the data storage nodes 2,3, so that the overlay object (intersection of data storage nodes of copy tables a, b) overlays the overlay object (data storage node of non-copy table c).
In the present embodiment, the matching of the query term to the merge condition can be determined based on the distribution attribute of the target data table. The distribution attributes include a copy table and a non-copy table. The replication table is a data table with the same storage content as the data table in the corresponding data storage nodes; the non-copy table is opposite to the copy table, and is a data table whose storage contents are different for the data tables in the corresponding data storage nodes. Further, the non-copy table may include a range table (range table), a hash table (hash table), and a list table (list table). The range table is a table with range limits for values in different data storage nodes; a hash table for determining which data storage node belongs to based on the hash value; the list table is a table directly specifying in the data table which data storage node is stored. It should be noted that, regardless of the distribution attribute, the data table creates the data table with the same name in all the data storage nodes, but only the data is stored in the data storage node corresponding to the data table. For example, when there are 1-10 data storage nodes in the distributed database environment, if the data storage nodes corresponding to the data table are 1,2, and 3 nodes, the data table creates a data table with the same name in all the 10 data storage nodes, but only stores data in the 1,2, and 3 nodes.
When the analysis determines that the query sentence meets the merge condition in the manner of step S241, in step S250, the data storage node corresponding to the merged query sentence is the intersection of the data storage nodes of each copy table.
When the query statement is determined to meet the merge condition by the analysis in step S243, in step S250, the data storage node corresponding to the merged query statement is each data storage node of the non-copy table.
If it is not possible to determine whether the query sentence meets the merge condition only according to the distribution attribute of the target data table, the analysis of whether the query sentence meets the merge condition may be further performed according to the structure of the query sentence. The following two embodiments include two cases where it is temporarily impossible to determine whether the merge condition is met only by distributing the attribute, and it can be determined that the merge condition is met after combining the query statement.
With continued reference to fig. 4, in one embodiment, the step of analyzing to determine whether the query statement meets the merge condition, i.e. step S240, further includes:
s245: if the target data table comprises at least two non-copy tables and the query statement comprises an equivalent chain or a where value chain, filtering the non-copy tables according to the data storage nodes of the target data table related to the equivalent chain or the where value chain.
S247: after the distribution attribute of the non-copy table which only comprises a single data storage node after filtering is modified into the copy table, analysis is carried out to determine whether the query statement accords with the merging condition.
When the target data table is determined to comprise at least two non-duplicate tables according to the distribution attribute of the target data table, whether the query statement accords with the merging condition or not can not be determined temporarily only according to the distribution attribute, and further analysis is needed according to the structure of the query statement. When the query statement comprises an equivalent chain or a where value chain, filtering the non-duplicate table according to the data storage node of the target data table related to the equivalent chain or the where value chain; and modifying the distribution attribute of the non-copy table which only comprises a single data storage node after filtering into a copy table, and iteratively executing the step of analyzing and determining whether the query statement accords with the merging condition. Therefore, the merging rules among the target data tables are simplified, and whether the query statement accords with the merging conditions can be determined only according to the distribution attribute of the target data tables. And then the query sentences are combined, so that the number of data storage nodes required to be processed is reduced, and the query efficiency of the query sentences is improved. The equivalent chain refers to codes which describe equality relation in the query statement; the where value chain refers to the code in the query statement that includes where and its specifics.
On the basis of the above embodiment, the step of analyzing and determining whether the query sentence meets the merging condition, that is, step S240, further includes:
s249: if each filtered non-copy table comprises at least two identical data storage nodes and the interval coverage relation exists among the data storage nodes of each non-copy table, the query statement accords with the merging condition.
If the filtered non-copy table contains no single data storage node, namely at least two data storage nodes, and the data storage nodes contained in each non-copy table are identical, and a section coverage relationship exists among the data storage nodes, the query statement can be determined to meet the merging condition. The query sentences in this case may be combined, and in this case, in step S250, the data storage nodes corresponding to the combined query sentences are the data storage nodes included in each of the filtered non-copy tables.
The section coverage relation refers to that the data values of specific data in the data tables with the same name, which are to be queried by query sentences stored in the data storage nodes of the non-replication tables, have coverage relations in the range. For example, the range tables a and b are both stored in the data storage nodes 1 and 2, one data in the range table a is stored in the data storage node 1 in a range of 50-100, and the data storage node 2 in a range of 1000-2000; the same data in the range table b has a storage range of 50-60 in the storage node 1 and a storage range of 1000-1200 in the data storage node 2, and the range table a and the range table b show that a section coverage relationship exists between the data storage nodes. It will be appreciated that the coverage may be a coverage b, b coverage a, or a coverage b on node 1, b coverage a on node 2, etc., and is not limited to this example.
With continued reference to fig. 3, in one embodiment, before the step of analyzing to determine whether the query sentence meets the merge condition, i.e., before step S240, the method further includes:
s230: metadata information is acquired and stored, wherein the metadata information comprises distribution attributes of a data table and data storage nodes of the data table. The distribution attributes include a copy table and a non-copy table.
In this way, metadata information is stored in the distributed database proxy, and distribution attributes of the target data table can be obtained according to the stored metadata information, so as to determine whether the target data table is a copy table, whether the target data table comprises a non-copy table, not less than one copy table, not less than two non-copy tables, and the like, and determine data storage nodes of each data table.
The following describes the advantageous effects of the above-described distributed database query method with a specific example.
Referring to fig. 5, a comparison is made between a conventional query process without merging query sentences and a query process with merging query sentences by the above-mentioned query method of the present invention.
When the distributed database agent receives a multi-table joint query statement, it is assumed that the target data table includes table a and table b. Tables a and b are copy tables, and table a is located between data storage node 1 and data storage node 3; table b is on data storage node 2. The target data table comprises query sentences for querying a and b, and the traditional query process is as follows: the proxy (distributed database agent) needs to send query sentences to the data storage node 1, the data storage node 2 and the data storage node 3 for query, then each data storage node returns a processing result to the proxy, and the proxy receives the processing result and then performs data processing, namely query operation, wherein the data processing or query operation can be operations such as data deduplication and result ordering, and the like, and can be specifically determined according to query sentence conditions. The target data table comprises query sentences for querying a and b, and the query process of the invention comprises the following steps: the proxy analyzes the query statement, and because the table a and the table b are copy tables and the data storage nodes have intersection sets of the data storage nodes 2, the analysis result is that the query statement accords with the merging condition, the query statement is merged according to the merging rule, in this specific example, only the merged query statement needs to be issued to the data storage nodes 2 for query, and at this moment, the proxy only needs to send the merged query statement to the data storage nodes 2 for direct execution, so that the result can be obtained. The combined query sentences are issued to the corresponding fewer data storage nodes for processing, so that the number of the data storage nodes required to be processed is reduced, the processing of the distributed database agent is reduced, the burden of the distributed database agent is lightened, and the execution speed can be improved, therefore, the query efficiency is high.
The invention also provides a distributed database query device corresponding to the distributed database query method.
Referring to fig. 6, a distributed database query apparatus according to an embodiment includes:
a query statement receiving module 610, configured to receive a query statement, where the query statement includes a target data table, and the target data table is a data table of a database to be queried in the query statement;
the query statement analysis module 640 is configured to analyze and determine whether the query statement meets the merging condition when the target data table includes more than two target data tables;
the statement merge issuing module 650 is configured to merge the query statement according to a merge rule corresponding to the merge condition when the query statement meets the merge condition, and issue the merged query statement to a corresponding data storage node for processing.
According to the device, the query statement accords with the merging condition, the merging processing is carried out according to the merging rule corresponding to the merging condition, all data storage nodes of all target data tables are not required to be accessed, only the necessary data storage nodes are required to be accessed, and the number of the data storage nodes corresponding to the merged data storage nodes is smaller than that of the data storage nodes before merging. Therefore, the combined query statement can be issued to the corresponding data storage node for processing, and the query result which is the same as the processing of more data storage nodes corresponding to the query statement before combination is obtained. Meanwhile, because the combined query sentences are issued to the corresponding fewer data storage nodes for processing, the number of the data storage nodes needing to be processed is reduced, the processing of the distributed database agent is reduced, the burden of the distributed database agent is lightened, and the execution speed can be improved, so that the query efficiency is high.
Referring to fig. 7, in one embodiment, the method further includes:
a query term splitting module 660 for splitting the query term into simple terms meeting the merging condition when the query term does not meet the merging condition;
the simple sentence merging module 670 is configured to merge simple sentences according to a merge rule, and send each merged simple sentence to a corresponding data storage node for processing;
the intermediate result receiving module 680 is configured to receive a processing result returned by each data storage node, where the processing result is a query result corresponding to the combined simple sentence;
and the query result determining module 690 is configured to perform a query operation on the processing result according to the query statement, so as to obtain a query result corresponding to the query statement.
Referring to fig. 8, in one embodiment, the query term analysis module 640 includes:
a first deep analysis unit 641, configured to, if each target data table is a replication table and there is an intersection between data storage nodes of each replication table, match the query statement with the merging condition;
or/and the like,
the second deep analysis unit 643 is configured to, if the target data table includes a non-replication table and at least one replication table, and an intersection of data storage nodes of each replication table covers the data storage nodes of the non-replication table, match the query statement with the merging condition.
Further, the query statement analysis module 640 further includes:
the third deep analysis unit 645 is configured to filter, if the target data table includes at least two non-duplicate tables and the query statement includes an equivalent chain or a where value chain, the non-duplicate tables according to a data storage node of the target data table related to the equivalent chain or the where value chain;
the third deep analysis unit 645 is further configured to analyze and determine whether the query sentence meets the merge condition after modifying the distribution attribute of the non-copy table that includes only the single data storage node after filtering to the copy table.
Still further, the query statement analysis module 640 further includes:
the fourth deep analysis unit 647 is configured to, if each filtered non-duplicate table includes at least two identical data storage nodes and there is a section coverage relationship between the data storage nodes of each non-duplicate table, match the query statement with the merging condition.
With continued reference to fig. 7, in one embodiment, the method further includes:
a data acquisition and storage module 630, configured to acquire and store metadata information, where the metadata information includes distribution attributes of a data table and data storage nodes of the data table; the distribution attributes include a copy table and a non-copy table.
The invention also provides a computer device corresponding to the distributed database query method, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the distributed database query method when executing the computer program.
The invention also provides a computer storage medium corresponding to the distributed database query method, wherein the computer storage medium is stored with a computer program, and when the computer program is executed by a processor, the steps of the distributed database query method are realized.
Since the apparatus, the computer device, and the computer storage medium correspond to the method, detailed technical features corresponding to the method in the apparatus, the computer device, and the computer storage medium are not described herein.
The foregoing examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that numerous variations and modifications could be made to the person skilled in the art without departing from the spirit of the invention, which would fall within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.

Claims (9)

1. A distributed database query method, comprising:
receiving a query statement, wherein the query statement comprises a target data table, and the target data table is a data table of a database to be queried in the query statement;
when the target data table comprises more than two, analyzing and determining whether the query statement accords with a merging condition;
when the query statement accords with the merging condition, merging the query statement according to a merging rule corresponding to the merging condition, and issuing the merged query statement to a corresponding data storage node for processing;
the step of analyzing to determine whether the query statement meets a merge condition includes: if the target data tables are copy tables and intersections exist in the data storage nodes of the copy tables, the query statement accords with the merging condition; or/and, if the target data table comprises a non-copy table and at least one copy table, and the intersection of the data storage nodes of each copy table covers the data storage nodes of the non-copy table, the query statement accords with the merging condition.
2. The distributed database query method of claim 1, further comprising:
when the query statement does not accord with the merging condition, splitting the query statement into simple statements accord with the merging condition;
merging the simple sentences according to the merging rules, and issuing each merged simple sentence to a corresponding data storage node for processing;
receiving a processing result returned by each data storage node, wherein the processing result is a query result corresponding to the combined simple statement;
and carrying out query operation on the processing result according to the query statement to obtain a query result corresponding to the query statement.
3. The distributed database query method of claim 1, wherein the step of analytically determining whether the query statement meets a merge condition further comprises:
if the target data table comprises at least two non-copy tables and the query statement comprises an equivalent chain or a where value chain, filtering the non-copy tables according to a data storage node of the target data table related to the equivalent chain or the where value chain;
and after modifying the distribution attribute of the non-copy table which only comprises a single data storage node after filtering into a copy table, analyzing and determining whether the query statement accords with the merging condition.
4. A distributed database query method as claimed in claim 3, wherein the step of analysing to determine whether the query statement meets a merge condition further comprises:
if each filtered non-duplicate table comprises at least two identical data storage nodes and a section coverage relation exists between the data storage nodes of each non-duplicate table, the query statement accords with the merging condition.
5. The method of any one of claims 1-4, wherein prior to the step of analyzing to determine whether the query statement meets a merge condition, further comprising:
acquiring and storing metadata information, wherein the metadata information comprises distribution attributes of the data table and data storage nodes of the data table; the distribution attributes include a replication table and a non-replication table.
6. A distributed database query apparatus, comprising:
the query statement receiving module is used for receiving a query statement, wherein the query statement comprises a target data table, and the target data table is a data table of a database to be queried in the query statement;
the query statement analysis module is used for analyzing and determining whether the query statement accords with the merging condition when the target data table comprises more than two target data tables; the step of analyzing to determine whether the query statement meets a merge condition includes: if the target data tables are copy tables and intersections exist in the data storage nodes of the copy tables, the query statement accords with the merging condition; or/and, if the target data table includes a non-copy table and at least one copy table, and the intersection of the data storage nodes of each copy table covers the data storage nodes of the non-copy table, the query statement accords with the merging condition;
and the statement merging and issuing module is used for merging the query statement according to the merging rule corresponding to the merging condition when the query statement accords with the merging condition, and issuing the merged query statement to the corresponding data storage node for processing.
7. The distributed database querying device as in claim 6, further comprising:
the query sentence splitting module is used for splitting the query sentence into simple sentences conforming to the merging conditions when the query sentence does not conform to the merging conditions;
the simple sentence merging module is used for merging the simple sentences according to the merging rules and issuing the merged simple sentences to corresponding data storage nodes for processing;
the intermediate result receiving module is used for receiving the processing results returned by the data storage nodes, wherein the processing results are query results corresponding to the combined simple sentences;
and the query result determining module is used for carrying out query operation on the processing result according to the query statement to obtain a query result corresponding to the query statement.
8. A computer device comprising a memory, a processor and a computer program stored on said memory and executable on said processor, characterized in that said processor implements the steps of the distributed database querying method according to any of claims 1-5 when said computer program is executed by said processor.
9. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the distributed database querying method according to any of claims 1 to 5.
CN201710484200.2A 2017-06-23 2017-06-23 Distributed database query method, device, equipment and storage medium Active CN109117426B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710484200.2A CN109117426B (en) 2017-06-23 2017-06-23 Distributed database query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710484200.2A CN109117426B (en) 2017-06-23 2017-06-23 Distributed database query method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109117426A CN109117426A (en) 2019-01-01
CN109117426B true CN109117426B (en) 2023-06-09

Family

ID=64732951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710484200.2A Active CN109117426B (en) 2017-06-23 2017-06-23 Distributed database query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109117426B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309149A (en) * 2019-06-06 2019-10-08 平安科技(深圳)有限公司 A kind of tables of data processing method, device, electronic equipment and storage medium
CN112364059B (en) * 2020-11-10 2023-12-22 国网甘肃省电力公司白银供电公司 Correlation matching method, device, equipment and storage medium under multi-rule scene
CN113792079B (en) * 2021-11-17 2022-02-08 腾讯科技(深圳)有限公司 Data query method and device, computer equipment and storage medium
CN117331919A (en) * 2023-09-18 2024-01-02 本原数据(北京)信息技术有限公司 Database joint query method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455641A (en) * 2013-09-29 2013-12-18 方正国际软件有限公司 Crossing repeated retrieval system and method
CN104123374A (en) * 2014-07-28 2014-10-29 北京京东尚科信息技术有限公司 Method and device for aggregate query in distributed databases
CN104699788A (en) * 2015-03-16 2015-06-10 百度在线网络技术(北京)有限公司 Database query method and device
CN105975617A (en) * 2016-05-20 2016-09-28 北京京东尚科信息技术有限公司 Multi-partition-table inquiring and processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AUPR796701A0 (en) * 2001-09-27 2001-10-25 Plugged In Communications Pty Ltd Database query system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455641A (en) * 2013-09-29 2013-12-18 方正国际软件有限公司 Crossing repeated retrieval system and method
CN104123374A (en) * 2014-07-28 2014-10-29 北京京东尚科信息技术有限公司 Method and device for aggregate query in distributed databases
CN104699788A (en) * 2015-03-16 2015-06-10 百度在线网络技术(北京)有限公司 Database query method and device
CN105975617A (en) * 2016-05-20 2016-09-28 北京京东尚科信息技术有限公司 Multi-partition-table inquiring and processing method and device

Also Published As

Publication number Publication date
CN109117426A (en) 2019-01-01

Similar Documents

Publication Publication Date Title
CN110032604B (en) Data storage device, translation device and database access method
CN109117426B (en) Distributed database query method, device, equipment and storage medium
US6470333B1 (en) Knowledge extraction system and method
US9298774B2 (en) Changing the compression level of query plans
US7657515B1 (en) High efficiency document search
CN106708996B (en) Method and system for full text search of relational database
US11030196B2 (en) Method and apparatus for processing join query
US8880463B2 (en) Standardized framework for reporting archived legacy system data
US20140046928A1 (en) Query plans with parameter markers in place of object identifiers
EP3385864B1 (en) Method and device for establishing index
US9734176B2 (en) Index merge ordering
CN111581234B (en) RAC multi-node database query method, device and system
CN109241100B (en) Query method, device, equipment and storage medium
CN112579610A (en) Multi-data source structure analysis method, system, terminal device and storage medium
CN111651424B (en) Data processing method, device, data node and storage medium
CN114139040A (en) Data storage and query method, device, equipment and readable storage medium
JP2024504322A (en) Combining JavaScript Object Notation (JASON) queries across cloud resources
US20080082516A1 (en) System for and method of searching distributed data base, and information management device
CN111611222A (en) Data dynamic processing method based on distributed storage
CN109684351A (en) A kind of executive plan inspection method, device, server and storage medium
CN116775698B (en) Partition clipping method and device for database, computer equipment and storage medium
Skovhede et al. Big Data Analysis with Skeletons on SOFA
WO2017019562A1 (en) Structural equivalence
KR20230015073A (en) Method And Apparatus for Data Preprocessing
KR20230021388A (en) Method And Computer Program for Data Preprocessing

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
TA01 Transfer of patent application right

Effective date of registration: 20220107

Address after: 100176 602, floor 6, building 6, courtyard 10, KEGU 1st Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing (Yizhuang group, high-end industrial area of Beijing Pilot Free Trade Zone)

Applicant after: Jinzhuan Xinke Co.,Ltd.

Address before: 518000 Zhongnan communication tower, South China Road, Nanshan District high tech Industrial Park, Shenzhen, Guangdong

Applicant before: ZTE Corp.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant