A node probe based path selection and execution method and system

CN117951165BActive Publication Date: 2026-10-27BEIJING VASTDATA TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410179808.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-18
Publication Date
2026-10-27
Estimated Expiration
2044-02-18

AI Technical Summary

Technical Problem

如果在执行过程中出现实际结果与估算存在较大甚至极大偏差的情况,优化器对此一无所知,也就无法对自己的下一次估算进行纠正,错误估算会继续出现

Benefits of technology

[0026]本发明基于节点探针的路径选择和执行方法和系统,在执行节点中嵌入优化器探针,允许优化器选择性的自主跟踪最终执行状况,通过观察估算结果与实际执行的预测偏差进行自主演进,在后续生成路径时的代价估算过程中参考探针的观测结果,对估算结果进行矫正,使路径代价更加接近真实结果,使原本存在较大误差的路径在最优路径选择过程中具有更准确的参考价值,提高优化器的路径选择准确率。基于由优化器主动发起结果探测的软件设计框架,不会对执行器产生干扰。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117951165B_ABST
    Figure CN117951165B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of relational database query optimization, and provides a path selection and execution method and system based on node probes, which comprises the following steps: receiving a query tree by using an optimizer, generating a plurality of execution path nodes according to the received query tree, screening the execution path nodes that need to be implanted with probes from the generated execution path nodes according to the result attributes of the execution path nodes, applying probes to the execution path nodes of the optimizer by a planner when generating the operators that need to be implanted with probes, implanting the obtained probes into the operators that need to be implanted with probes, monitoring the execution of the execution path nodes by using the probes implanted into the operators, and optimizing the generation of the execution path nodes by using the optimizer according to the monitoring information. The path selection and execution method and system based on node probes can actively and selectively detect the execution results, evolve the estimation behavior of itself, make the guessed results more close to the real results, and improve the accuracy of the optimizer in path selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of relational database query optimization technology, and in particular to a path selection and execution method and system based on node probes. Background Technology

[0002] After introducing cost-based query optimization (CBO), relational databases performed quantitative analysis of query execution plans, evaluated each possible execution method, and selected the plan with the lowest cost as the optimal plan. The key to query cost estimation is the cost estimation model, which is the basis for physical query optimization.

[0003] Besides the cost estimation model, the selection rate is also a very important concept, playing a crucial role in cost calculation. Databases often use random sampling to generate statistical information to analyze data distribution. Since the optimizer makes estimations based on pre-defined assumptions and statistical information, and especially because statistical information can be distorted and time-sensitive, it is impossible to determine whether failures or excessive biases have led to estimation errors, thus making it impossible to determine whether the guessed result meets expectations.

[0004] Figure 1 This provides an example of the path selection and execution process for relational database queries in existing technologies, such as... Figure 1 As shown, the optimizer receives the query tree processed by the upper-level (generally logic optimization and rewriting) module, generates multiple execution paths based on the query tree, selects the path it considers to have the lowest cost as the optimal path and passes it to the lower-level module (planner). After that, the work is done and will not affect the subsequent plan creation and execution process. Figure 2 An example diagram illustrating the impact of node costs in practical applications, such as... Figure 2 As shown, in computations within the same environment (the same computer), the unit price of resources is fixed, and the total consumption is related to the number of resources accessed. Therefore, whether the optimizer can obtain an accurate estimate directly affects the accuracy of the cost. The accuracy of the estimate is related to the nature of the data source; not all data sources can provide a reasonable guess. The accuracy of the source information and the complexity of the source attributes directly affect the accuracy of the estimation result. If, during execution, the actual result deviates significantly or even drastically from the estimate, the optimizer is unaware of this and cannot correct its next estimate, leading to continued erroneous estimations.

[0005] Therefore, improving the path selection accuracy of the optimizer has become an urgent technical problem to be solved. Summary of the Invention

[0006] In view of this, in order to overcome the shortcomings of the prior art, the present invention aims to provide a path selection and execution method and system based on node probes.

[0007] According to a first aspect of the present invention, a path selection and execution method based on node probes is provided, characterized in that the method includes:

[0008] An optimizer receives the query tree and generates multiple execution path nodes based on the received query tree.

[0009] Based on the result attributes of the execution path nodes, select the execution path nodes that need to be implanted with probes from the generated execution path nodes;

[0010] When the planner generates operators that need to be implanted with probes, it requests probes from the execution path nodes of the optimizer and implants the obtained probes into the operators that need to be implanted with probes.

[0011] The execution of execution path nodes is monitored by probes with implanted operators, and the generation of execution path nodes is optimized by an optimizer based on the monitoring information.

[0012] Preferably, in the path selection and execution method based on node probes of the present invention, an optimizer is used to receive the query tree and generate multiple execution path nodes based on the received query tree, including: before receiving the query tree using the optimizer, performing logical optimization and rewriting processing on the query tree.

[0013] Preferably, in the path selection and execution method based on node probes of the present invention, the execution path nodes that need to be implanted with probes are screened from the generated execution path nodes according to the result attributes of the execution path nodes, including: when screening the execution path nodes that need to be implanted with probes, the execution path nodes are evaluated, and the execution path nodes with definite results are determined as execution path nodes that do not need to be implanted with probes.

[0014] Preferably, in the path selection and execution method based on node probes of the present invention, the execution path nodes with determined results include: unconditional basic scan path nodes with timely statistical information, basic scan path nodes or connection path nodes with determined conditions, and non-data production path nodes. The determined conditions include constant conditions or reliable reference association conditions. The non-data production path nodes include some transition path nodes and intermediate data collection path nodes.

[0015] Preferably, in the path selection and execution method based on node probes of the present invention, when the planner generates operators that need to be implanted with probes, it requests probes from the execution path nodes of the optimizer, and implants the obtained probes into the operators that need to be implanted with probes, including:

[0016] The planner requests probes from the path nodes in the optimizer using path signature codes;

[0017] When the path node is an execution path node that needs to be implanted with a probe, the optimizer creates a probe on the execution path node and sends the created probe to the planner. After receiving the probe, the planner generates the corresponding operator and implants the received probe into the generated operator.

[0018] When the execution path node is an execution path node that does not require the implantation of a probe, the optimizer returns an empty probe to the planner. After receiving the empty probe, the planner generates the corresponding operator.

[0019] Preferably, in the path selection and execution method based on node probes of the present invention, the path feature code includes the node type of the execution path node, the subtype of the execution path node, and the node attributes of the execution path node.

[0020] Preferably, in the path selection and execution method based on node probes of the present invention, probes with implanted operators are used to monitor the execution of execution path nodes, and an optimizer is used to optimize the generation of execution path nodes based on the monitoring information, including:

[0021] After the planner's operators finish running, they write execution statistics to the probes of the corresponding execution path nodes in the optimizer.

[0022] The optimizer uses probes on the execution path nodes to detect path nodes that deviate from the path selection and execution estimation based on execution statistics, records the node information of the path nodes with deviations, and adjusts the cost of the path nodes based on the recorded node information.

[0023] Preferably, in the path selection and execution method based on node probes of the present invention, the node information includes node probes, path node execution results, and execution time.

[0024] According to a second aspect of the present invention, a path selection and execution system based on node probes is provided. The system includes a path selection and execution server, which is configured to: receive a query tree using an optimizer and generate multiple execution path nodes based on the received query tree; filter execution path nodes that require probe insertion from the generated execution path nodes based on the result attributes of the execution path nodes; request probes from the optimizer's execution path nodes when generating operators that require probe insertion, and insert the requested probes into the operators that require probe insertion; monitor the execution of the execution path nodes using the probes of the inserted operators; and optimize the generation of execution path nodes using the optimizer based on the monitoring information.

[0025] According to a third aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect of the present invention.

[0026] This invention relates to a path selection and execution method and system based on node probes. An optimizer probe is embedded in the execution node, allowing the optimizer to selectively and autonomously track the final execution status. It autonomously evolves by observing the deviation between the estimated results and the predicted actual execution. During subsequent cost estimation in path generation, the probe's observations are referenced to correct the estimated results, making the path cost closer to the actual outcome. This ensures that paths with significant errors have more accurate reference value in the optimal path selection process, improving the optimizer's path selection accuracy. Based on a software design framework where the optimizer actively initiates result probing, it does not interfere with the executor. Attached Figure Description

[0027] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This provides an example of the path selection and execution process for relational database queries in existing technologies.

[0029] Figure 2 This is an example diagram illustrating the impact of node costs in practical applications.

[0030] Figure 3 This is an exemplary system for a path selection and execution method based on node probes according to an embodiment of the present invention;

[0031] Figure 4 This is a flowchart illustrating the steps of a path selection and execution method based on node probes according to an embodiment of the present invention.

[0032] Figure 5 This is an example diagram illustrating the relationship between the optimizer, planner, probe, and operator in an embodiment of the present invention;

[0033] Figure 6 This is an example diagram of the planner requesting probe generation operator in the method of this embodiment of the invention;

[0034] Figure 7 This is an example diagram showing the writing of information to the probe in the optimizer after the operator has run in the method of this embodiment of the invention;

[0035] Figure 8 This is a schematic diagram of the structure of the device provided by the present invention. Detailed Implementation

[0036] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0037] It should be noted that, in the absence of conflict, the following embodiments and features can be combined with each other; and, based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0038] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0039] Figure 3 An exemplary system for a node probe-based path selection and execution method applicable to embodiments of this application is shown. For example... Figure 3 As shown, the system may include a path selection and execution server 101, a communication network 102, and / or one or more path selection and execution clients 103. Figure 3 The example in the text is client 103, which involves multiple path selections and execution.

[0040] The path selection and execution server 101 can be any suitable server used to store information, data, programs, and / or any other suitable type of content. In some embodiments, the path selection and execution server 101 can perform appropriate functions. For example, in some embodiments, the path selection and execution server 101 can be used for path selection and execution based on node probes. As an optional example, in some embodiments, the path selection and execution server 101 can be used to implement node probe-based path selection and execution by embedding probes in operators. For example, the path selection and execution server 101 can be used to receive a query tree with an optimizer, generate multiple execution path nodes based on the received query tree; filter execution path nodes that need to be implanted with probes from the generated execution path nodes based on the result attributes of the execution path nodes; when generating operators that need to be implanted with probes, the planner requests probes from the execution path nodes of the optimizer, and implants the requested probes into the operators that need to be implanted with probes; monitor the execution of the execution path nodes using the probes of the implanted operators, and optimize the generation of execution path nodes using the optimizer based on the monitoring information.

[0041] In this embodiment, the optimizer is a database module that performs internal optimization for user requests to find the path with the minimum cost; the planner is a database module that generates an execution plan based on the path and transmits it to the executor for execution; the executor is a database module that operates on the data according to the execution plan and returns the results to the user; the path represents a possible computation path (such as sequential scan or hash association); and the operator is an independent unit for planned execution, used to implement specific execution actions.

[0042] As another example, in some embodiments, the path selection and execution server 101 may send a node probe-based path selection and execution method to the path selection and execution client 103 for user use, based on a request from the path selection and execution client 103.

[0043] As an optional example, in some embodiments, the path selection and execution client 103 is used to provide a visual path selection and execution interface, which is used to receive user path selection and execution selection input operations, and to obtain from the path selection and execution server 101 the path selection and execution interface corresponding to the option selected by the selection input operation and display the path selection and execution interface in response to the selection input operation. The path selection and execution interface displays at least path selection and execution information and operation options for the path selection and execution information.

[0044] In some embodiments, communication network 102 may be any suitable combination of one or more wired and / or wireless networks. For example, communication network 102 may include any one or more of the following: the Internet, intranet, wide area network (WAN), local area network (LAN), wireless network, digital subscriber line (DSL) network, frame relay network, asynchronous transfer mode (ATM) network, virtual private network (VPN), and / or any other suitable communication network. Path selection and execution client 103 may be connected to communication network 102 via one or more communication links (e.g., communication link 104), which may be linked to path selection and execution server 101 via one or more communication links (e.g., communication link 105). Communication links may be any communication link suitable for transmitting data between path selection and execution client 103 and path selection and execution server 101, such as network links, dial-up links, wireless links, hardwired links, any other suitable communication links, or any suitable combination of such links.

[0045] The path selection and execution client 103 may include any one or more clients that present an interface related to high-speed access to ORC external tables in a suitable form for user use and operation. In some embodiments, the path selection and execution client 103 may include any suitable type of device. For example, in some embodiments, the path selection and execution client 103 may include a mobile device, tablet computer, laptop computer, desktop computer, and / or any other suitable type of client device.

[0046] Although the path selection and execution server 101 is illustrated as a single device, in some embodiments, any suitable number of devices may be used to perform the functions performed by the path selection and execution server 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the path selection and execution server 101. Alternatively, cloud services may be used to implement the functions of the path selection and execution server 101.

[0047] Based on the above system, this application provides a path selection and execution method based on node probes, which will be described in the following embodiments.

[0048] Reference Figure 4 The diagram illustrates a flowchart of a path selection and execution method based on a node probe according to an embodiment of the present invention. Figure 5 This is an example diagram illustrating the relationship between the optimizer, planner, probe, and operator in this embodiment of the invention. The path selection and execution method based on node probes in this embodiment can be executed on the path selection and execution server, such as... Figure 4 and Figure 5 As shown, the node probe-based path selection and execution method includes the following steps:

[0049] Step S201: The optimizer receives the query tree and generates multiple execution path nodes based on the received query tree.

[0050] As an optional example, in the method of this embodiment of the invention, the query tree is logically optimized and rewritten before being received by the optimizer.

[0051] Step S202: Based on the result attributes of the execution path nodes, select the execution path nodes from the generated execution path nodes that need to be implanted with probes.

[0052] As an optional example, in this embodiment, when screening execution path nodes that require probe implantation, the method evaluates the execution path nodes and determines those with a definite result as execution path nodes that do not require probe implantation. It should be noted that in this embodiment, the execution path nodes with a definite result include:

[0053] 1. Statistical information is timely and includes unconditional basic scan path nodes, enabling accurate estimation of scan results;

[0054] 2. Basic scan path nodes or connecting path nodes with defined conditions, including constant conditions or reliable reference association conditions. When constant conditions are present, the scan results can be accurately estimated based on statistical information. When reliable reference association conditions are present (statistical information can accurately reflect the data distribution), such conditions can yield an estimate equivalent to that of constant conditions.

[0055] 3. Non-data production path nodes, including some transitional path nodes and intermediate data collection path nodes, do not have the function of affecting the results themselves.

[0056] When implementing the method of this invention, those skilled in the art can set and select the execution path nodes that need to be implanted with probes according to the actual needs of the scenario. The method of this embodiment does not impose any restrictions on this. In the method of this embodiment, when the optimizer evaluates the execution path nodes, it selectively uses probes for each path node and does not embed paths with definite results, thereby reducing the scope of influence on the executor's execution operators.

[0057] Step S203: When the planner generates an operator that needs to be implanted with a probe, it requests a probe from the execution path node of the optimizer and implants the obtained probe into the operator that needs to be implanted with a probe.

[0058] As an optional example, in the method of this embodiment of the invention, the planner requests probes from the path nodes in the optimizer through path feature codes; when the path node is an execution path node that needs to have probes implanted, the optimizer creates a probe on the execution path node and sends the created probe to the planner. After receiving the probe, the planner generates the corresponding operator and implants the received probe into the generated operator; when the execution path node is an execution path node that does not need to have probes implanted, the optimizer returns an empty probe to the planner. After receiving the empty probe, the planner generates the corresponding operator.

[0059] In this embodiment, the planner acts as the probe implantation module. It only needs to request the probe from the optimizer when generating the operator that needs to be implanted with the probe, and then implant it into the operator. It does not need to care about the details of the probe, but only plays a passing role, minimizing the impact on it.

[0060] In this embodiment, the method distinguishes whether an execution path needs probe implantation through path feature codes. It's important to note that in this embodiment, the path feature code includes the node type of the execution path node, its subtype, and its attributes. In practical applications, some execution path nodes have no subtypes, while others do. For example, sequential scan nodes have no subtypes, while hash join nodes have subtypes such as Semi, Anti, and Full. The node attributes of an execution path node include hash clauses, join conditions, and filtering conditions. Based on these attributes, execution path nodes of the same type can be further distinguished. Figure 6 This is an example diagram of the planner requesting probe generation operator in the method of this embodiment of the invention, such as... Figure 6 As shown, in practical applications, the path generator in the planner sends a probe request to the probe sensor in the optimizer. After receiving the probe request, the probe sensor sends the probe handle of the corresponding probe it senses to the path generator.

[0061] In practical applications, the estimation results are time-sensitive and will become invalid after a certain period of time, such as 30 minutes. In addition, the number of plans and node types in the business system is a fixed combination and will not increase indefinitely. In the method of this embodiment, the optimizer can detect whether its previous observation results have changed through probes. The number of detection results is tens to thousands. Compared with the number of 4.2 billion feature code intervals, it significantly improves efficiency while reducing the possibility of path feature code conflicts to zero.

[0062] Step S204: Use the probe of the implanted operator to monitor the execution of the execution path node, and use the optimizer to optimize the generation of the execution path node based on the monitoring information.

[0063] As an optional example, in this embodiment, after the planner's operator finishes running, it writes execution statistics to the probes of the corresponding execution path nodes in the optimizer. The optimizer, using the execution statistics, detects path nodes that deviate from the path selection and execution estimation, records the node information of these deviated path nodes, and adjusts the cost of the path nodes based on the recorded node information. The node information includes the node probe, the path node execution result, and the execution time.

[0064] For example, in this embodiment, the executor continues to manage, call, and control each operator according to its original definition, without needing to know about the probe's existence. The operator only needs to write execution statistics to the probe at the end if an optimizer probe is found. Each execution of the operator involves only one probe access, and the impact is negligible. If the optimizer probe is not present, nothing needs to be done, and there is no impact whatsoever. The operator also does not need to care about how the probe processes and uses the data.

[0065] The optimizer uses probes to detect nodes that deviate from the estimated results, recording the path node characteristics, actual results, and the time of occurrence. During path generation, this information can be used to adjust the actual cost of nodes. If no cost record requires adjustment, the existing estimation logic is used. For nodes that are calibrated or uncalibrated, after the optimizer decides whether to use the probe, the process returns to the optimizer, planner, and executor flow, forming an information loop that continuously optimizes the entire cost calculation process. Figure 7 This is an example diagram illustrating the writing of information to the probe in the optimizer after the operator runs in the method of this embodiment of the invention, such as... Figure 7 As shown, after the operator finishes running, it writes execution statistics such as execution time, resource consumption, and execution results to the probe in the optimizer.

[0066] This invention relates to a path selection and execution method and system based on node probes. An optimizer probe is embedded in the execution node, allowing the optimizer to selectively and autonomously track the final execution status. It autonomously evolves by observing the deviation between the estimated results and the predicted actual execution. During subsequent cost estimation in path generation, the probe's observations are referenced to correct the estimated results, making the path cost closer to the actual outcome. This ensures that paths with significant errors have more accurate reference value in the optimal path selection process, improving the optimizer's path selection accuracy. Based on a software design framework where the optimizer actively initiates result probing, it does not interfere with the executor.

[0067] like Figure 8 As shown, the present invention also provides a device including a processor 310, a communication interface 320, a memory 330 for storing a processor-executable computer program, and a communication bus 340. The processor 310, communication interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 implements the aforementioned node probe-based path selection and execution method by running the executable computer program.

[0068] The computer program in memory 330, when implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0069] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected based on actual needs to achieve the purpose of this embodiment. Those skilled in the art can understand and implement this without any creative effort.

[0070] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0071] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A path selection and execution method based on node probes, characterized in that, The method includes: An optimizer receives the query tree and generates multiple execution path nodes based on the received query tree. Based on the result attributes of the execution path nodes, select the execution path nodes that need to be implanted with probes from the generated execution path nodes; When the planner generates operators that need to be implanted with probes, it requests probes from the execution path nodes of the optimizer and implants the obtained probes into the operators that need to be implanted with probes. The execution of execution path nodes is monitored by probes with implanted operators, and the generation of execution path nodes is optimized by an optimizer based on the monitoring information. When the planner generates operators that require probe insertion, it requests probes from the optimizer's execution path nodes and inserts the obtained probes into the operators that require probe insertion, including: The planner requests probes from the path nodes in the optimizer using path signature codes; When the path node is an execution path node that needs to be implanted with a probe, the optimizer creates a probe on the execution path node and sends the created probe to the planner. After receiving the probe, the planner generates the corresponding operator and implants the received probe into the generated operator. When the execution path node is an execution path node that does not require the implantation of a probe, the optimizer returns an empty probe to the planner. After receiving the empty probe, the planner generates the corresponding operator. The execution of execution path nodes is monitored using probes with implanted operators, and an optimizer optimizes the generation of execution path nodes based on the monitoring information, including: After the planner's operators finish running, they write execution statistics to the probes of the corresponding execution path nodes in the optimizer. The optimizer uses probes on the execution path nodes to detect path nodes that deviate from the path selection and execution estimation based on execution statistics, records the node information of the path nodes with deviations, and adjusts the cost of the path nodes based on the recorded node information. Node information includes node probes, path node execution results, and execution time.

2. The path selection and execution method based on node probes according to claim 1, characterized in that, An optimizer is used to receive the query tree, and multiple execution path nodes are generated based on the received query tree. This includes: performing logical optimization and rewriting on the query tree before the optimizer receives the query tree.

3. The path selection and execution method based on node probes according to claim 1, characterized in that, Based on the result attributes of the execution path nodes, the execution path nodes that need to be implanted with probes are selected from the generated execution path nodes, including: when selecting the execution path nodes that need to be implanted with probes, the execution path nodes are evaluated, and the execution path nodes with definite results are determined as execution path nodes that do not need to be implanted with probes.

4. The path selection and execution method based on node probes according to claim 3, characterized in that, The execution path nodes with definite results include: unconditional basic scan path nodes with time-sensitive statistical information, basic scan path nodes or connection path nodes with definite conditions, and non-data production path nodes. The definite conditions include constant conditions or reliable reference association conditions. The non-data production path nodes include some transition path nodes and intermediate data collection path nodes.

5. The path selection and execution method based on node probes according to claim 1, characterized in that, The path feature code includes the node type of the execution path node, the subtype of the execution path node, and the node attributes of the execution path node.

6. A path selection and execution system based on node probes, the system being used to implement the method as described in any one of claims 1 to 5, characterized in that, The system includes a path selection and execution server, which is used for: receiving a query tree using an optimizer and generating multiple execution path nodes based on the received query tree; filtering execution path nodes that need to be implanted with probes from the generated execution path nodes based on the result attributes of the execution path nodes; requesting probes from the optimizer's execution path nodes when the planner generates operators that need to be implanted with probes, and implanting the obtained probes into the operators that need to be implanted with probes; monitoring the execution of the execution path nodes using the probes of the implanted operators, and optimizing the generation of execution path nodes based on the monitoring information using the optimizer.

7. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Database query optimization method and device, electronic equipment, medium and program product

    CN114238389A

  • Database performance optimization method and device, storage medium and electronic equipment

    CN116860583A

  • Exploiting execution feedback for optimizing choice of access methods

    US20090094191A1