Database execution plan collection method, device, medium and product

By generating identifier values ​​and updating statistical information, the problem of large storage space occupation and high resource consumption of database execution plans is solved, achieving efficient storage space utilization and convenient analysis.

CN122086730APending Publication Date: 2026-05-26CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610204141.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-11
Publication Date
2026-05-26

Smart Images

  • Figure CN122086730A_ABST
    Figure CN122086730A_ABST
Patent Text Reader

Abstract

This invention provides a method, device, medium, and product for acquiring execution plans of a database. The method includes: detecting the completion of an operation statement execution and obtaining the execution plan of the operation statement; generating an identifier value based on the operation statement and the execution plan using a preset algorithm; detecting whether the identifier value exists in a preset storage space; if so, updating preset statistical information corresponding to the identifier value in the preset storage space, the preset statistical information including the number of executions and the maximum execution time. By merging similar operation statements and their corresponding execution plans for storage, only the structural features of similar execution plans and the textual features of operation statements need to be stored once, effectively reducing the storage space occupied by storing execution plans.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and in particular to a method, device, medium, and product for collecting execution plans for a database. Background Technology

[0002] In database applications, the execution efficiency of SQL (Structured Query Language) statements has a significant impact on database performance. Therefore, analyzing and optimizing the execution plans of inefficient SQL statements is an important means of improving database performance. Consequently, it is necessary for the database to retain the execution plans of SQL statements that meet the requirements during operation, so that database administrators can retrieve and analyze these execution plans later.

[0003] Currently, database logs are commonly used to record execution plans. That is, a log record is generated for each execution plan that meets the requirements. This not only occupies a large amount of storage space, but also consumes a lot of runtime resources. Summary of the Invention

[0004] One object of the present invention is to provide a method, apparatus, medium and product for acquiring execution plans of a database that helps reduce the storage space occupied by the stored execution plans.

[0005] Specifically, the present invention provides a method for collecting execution plans of a database, comprising: Once the execution of the operation statement is detected as complete, the execution plan of the operation statement is obtained; An identifier value is generated based on the operation statement and the execution plan using a preset algorithm; If the identifier value exists in the preset storage space, update the preset statistics information corresponding to the identifier value in the preset storage space. The preset statistics information includes the number of executions and the maximum execution time.

[0006] Optionally, the step of generating an identifier value based on the operation statement and the execution plan using a preset algorithm includes: Extract the structural features of the execution plan after removing numerical parameters; Obtain the text features generated after removing the constant parameters from the operation statement; The identifier value is generated based on the structural features and the text features using the preset algorithm.

[0007] Optionally, the step of detecting whether the identifier value exists in the preset storage space includes: If not, store the structural features of the execution plan, the text features of the operation statement with a preset text length, the identifier value, and the corresponding preset statistical information into the preset storage space.

[0008] Optionally, the preset storage space is a circular buffer.

[0009] Optionally, if a trigger condition for persistent storage of data stored in the circular buffer is detected, the data stored in the circular buffer is persistently stored in a preset statistics table.

[0010] Optionally, upon detecting a query request for a preset performance view, the corresponding data in the circular buffer is returned based on the query request, wherein the preset performance view is associated with the data stored in the circular buffer.

[0011] Optionally, the step of obtaining the execution plan of the operation statement includes the following steps before: If the execution time of the execution plan reaches a preset time threshold, then execute the step of obtaining the execution plan of the operation statement.

[0012] According to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer executable program stored in the memory and running on the processor, wherein the processor, when executing the computer executable program, implements an execution plan acquisition method for a database according to any one of the preceding claims.

[0013] According to another aspect of the present invention, a computer-readable storage medium is also provided, on which a computer-executable program is stored, which, when executed by a processor, implements the method for acquiring an execution plan of a database according to any one of the preceding claims.

[0014] According to another aspect of the present invention, a computer program product is also provided, comprising a computer executable program that, when executed by a processor, implements the method for acquiring an execution plan of a database according to any one of the preceding claims.

[0015] The database execution plan acquisition method of this invention obtains the execution plan of an operation statement after its execution is detected, generates an identifier value for the operation statement and the execution plan using a preset algorithm, and checks whether the identifier value exists in a preset storage space. If it exists, the preset statistical information corresponding to the identifier value in the preset storage space is updated. The preset statistical information includes the number of executions and the maximum execution time. In other words, similar operation statements and their corresponding execution plans are stored together, requiring only the storage of the structural features of similar execution plans and the text features of operation statements once, effectively reducing the storage space occupied by storing execution plans. Moreover, when an identifier value exists in the preset storage space, only the preset statistical information corresponding to the identifier value in the preset storage space needs to be updated. The preset statistical information includes the number of executions and the maximum execution time, resulting in less data operation and transmission, reducing the consumption of runtime resources. In addition, generating identifier values ​​by combining operation statements and execution plans reduces the storage space occupied by storing execution plans while ensuring the comprehensiveness of the retained execution plans, thereby avoiding adverse effects on execution plan analysis.

[0016] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0017] The following sections will describe some specific embodiments of the invention in a detailed manner by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic flowchart of a database execution plan acquisition method according to an embodiment of the present invention; Figure 2 This is a schematic flowchart illustrating the generation of identifier values ​​in a database execution plan acquisition method according to an embodiment of the present invention; Figure 3 This is a schematic flowchart of a database execution plan acquisition method according to another embodiment of the present invention; Figure 4 This is a schematic diagram of the database system architecture according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a computer device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; Figure 7 This is a schematic diagram of a computer program product according to an embodiment of the present invention. Detailed Implementation

[0018] Those skilled in the art should understand that the embodiments described below are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. These partial embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present invention.

[0019] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0020] The flowcharts provided in this invention are not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.

[0021] like Figure 1 As shown, in one embodiment, the database execution plan acquisition method generally includes: Step S101: The execution of the operation statement is detected to be complete, and the execution plan of the operation statement is obtained.

[0022] The operation statement, also known as the SQL statement, involves collecting the execution plan of an SQL statement after its execution. Specifically, this can be done through pre-configured hook functions.

[0023] Step S102: Generate an identifier value based on the operation statement and execution plan using a preset algorithm.

[0024] Reference Figure 2 As shown, specifically, this step includes: Step S201: Extract the structural features of the execution plan after removing numerical parameters.

[0025] Specifically, this means removing numerical parameters such as cost estimates and row count estimates from the execution plan, while retaining structural features such as node types, relation names, index names, and child node structures.

[0026] For example, for a raw execution plan: Hash Join (cost=1250.45..13567.89 rows=1500 width=200) Hash Cond: (orders.customer_id = customers.id) -> Seq Scan on orders (cost=0.00..12345.67 rows=150000 width=150) -> Hash (cost=1245.67..1245.67 rows=1567 width=50) -> Seq Scan on customers (cost=0.00..1245.67 rows=1567 width=50) After removing the numerical parameters, the structural features are obtained: Hash Join Hash Cond: (orders.customer_id = customers.id) -> Seq Scan on orders -> Hash -> Seq Scan on customers Step S202: Obtain the text features generated after removing constant parameters from the operation statement.

[0027] Specifically, this means removing or replacing constant parameters in the operation statement with placeholders.

[0028] For example, for a raw operation statement: SELECT * FROM orders WHERE customer_id =1001 Replace the constant parameter "1001" with the placeholder "$1" to obtain the text features: SELECT * FROM orders WHERE customer_id =$1 Step S203: Generate an identifier value based on structural features and text features using a preset algorithm.

[0029] Specifically, the structural features of the execution plan and the textual features of the operation statements are combined into a long character, and then a unique identifier value for the long character is obtained using a preset algorithm. For example, the SHA-256 algorithm or the MD5 algorithm can be used.

[0030] It should be noted that in some implementations, one of the structural features of the execution plan and the textual features of the operation statement may be used to generate a hash value first, and then combined with the other to calculate the identifier value.

[0031] Step S103: Detect whether there is an identifier value in the preset storage space. If yes, proceed to step S104; otherwise, proceed to step S105.

[0032] Specifically, the default storage space is a circular buffer. The circular buffer has a fixed memory footprint, unlike a regular cache which allocates memory without limit, thus avoiding impacting database memory usage. The circular buffer employs a first-in, first-out (FIFO) eviction mechanism, ensuring that the most recent execution plan information is retained within the circular buffer, aligning with monitoring strategies. Furthermore, the circular buffer offers better high-concurrency write performance, contributing to faster write speeds.

[0033] Step S104: Update the preset statistics corresponding to the identifier value in the preset storage space. The preset statistics include the number of executions and the maximum execution time. The number of executions is the number of times the identifier value appears since it was first recorded in the preset storage space, plus the number of subsequent occurrences. The maximum execution time is the longest execution time among all execution times corresponding to the same identifier value and the same number of executions.

[0034] Step S105: Store the structural features of the execution plan, the text features of the operation statements with preset text length, the identifier values, and the corresponding preset statistical information into the preset storage space.

[0035] Specifically, execution plans with the same structural characteristics and operation statements with the same textual characteristics can obtain the same identifier value.

[0036] By checking if a flag value exists in the preset storage space, if it doesn't, the structural features of the execution plan, the text features of the operation statements with a preset text length, the flag value, and the corresponding preset statistics are stored in the preset storage space. The structural features of the execution plan can be stored in JSON format. The preset text length refers to retaining only the text features of operation statements of a certain length, rather than storing the complete operation statements, thereby reducing storage space usage. Since the flag value does not exist, it indicates that the relevant data is being stored in the preset storage space for the first time, the execution count is recorded as 1, and the maximum execution time is the execution time of this execution plan.

[0037] If an identifier value exists, it means that the same structural and textual features already exist in the preset storage space. Therefore, it's only necessary to update the preset statistics corresponding to the identifier value within the preset storage space. For example, if the execution count corresponding to the current identifier value is 3, then the execution count will be updated to 4. Furthermore, the execution time of the current execution plan will be compared with the maximum execution time in the current preset storage space. If the execution time of the current execution plan is longer, the maximum execution time will be updated to the execution time of the current execution plan.

[0038] It should be noted that the preset statistics can also include the first occurrence time of the identifier value, the latest occurrence time, the total execution time for all execution counts, and the minimum execution time. This provides a more comprehensive record of the execution plan's relevant data, saving database administrators' analysis time.

[0039] In this embodiment, after the execution of an operation statement is detected, its execution plan is obtained. A preset algorithm is used to generate an identifier value for the operation statement and the execution plan. The existence of the identifier value in the preset storage space is then checked. If it exists, the preset statistical information corresponding to the identifier value in the preset storage space is updated. The preset statistical information includes the number of executions and the maximum execution time. In other words, similar operation statements and their corresponding execution plans are stored together. Only the structural features of similar execution plans and the text features of operation statements need to be stored once, effectively reducing the storage space occupied by storing execution plans. Moreover, when an identifier value exists in the preset storage space, only the preset statistical information corresponding to the identifier value in the preset storage space needs to be updated. The preset statistical information includes the number of executions and the maximum execution time, resulting in less data operation and transmission, reducing the consumption of runtime resources. In addition, generating identifier values ​​by combining operation statements and execution plans reduces the storage space occupied by storing execution plans while ensuring the comprehensiveness of the execution plans, thereby avoiding adverse effects on execution plan analysis.

[0040] If no identifier value exists in the preset storage space, the structural features of the execution plan, the text features of the operation statement with a preset text length, the identifier value, and the corresponding preset statistical information are stored in the preset storage space, thereby supporting the direct acquisition of the relevant structure of the execution plan and facilitating real-time access to the relevant execution plan.

[0041] Furthermore, storing execution plan data in a circular buffer first helps reduce the interaction between the execution plan storage process and disk space, lowering the resource consumption of database operations and ensuring the normal operation of critical database tasks. Moreover, the circular buffer has a fixed memory footprint, unlike ordinary caches which allocate memory without limit, thus avoiding impacting database memory usage. The circular buffer employs a first-in, first-out (FIFO) eviction mechanism, ensuring that the most recent execution plan information is retained, aligning with monitoring strategies. Additionally, the circular buffer offers better high-concurrency write performance, contributing to faster write speeds.

[0042] In one embodiment, the database execution plan collection method further includes: detecting a trigger condition for persistent storage of data stored in a circular buffer, and persistently storing the data stored in the circular buffer into a preset statistics table.

[0043] Specifically, the trigger condition for persistently storing data in the circular buffer can be reaching a preset period of time or the occupancy of the circular buffer reaching a preset percentage of its maximum capacity. Persisting the data stored in the circular buffer to a preset statistical table can be done by persisting all data to the preset statistical table or by persisting a preset percentage of the data to the preset statistical table.

[0044] During the process of persisting data stored in the circular buffer to a preset statistics table, for each execution plan to be persisted, the system first checks if a matching identifier value exists in the preset statistics table. If so, it updates the corresponding preset statistics information in the preset statistics table. Specifically, for preset statistics information that needs to be added, such as the number of executions or the total execution time, the values ​​in the circular buffer and the preset statistics table are added together. For preset statistics information that needs to be compared and updated, such as the latest occurrence time, the maximum execution time, and the minimum execution time, the values ​​in the circular buffer and the preset statistics table are compared to determine the values ​​that need to be stored in the preset statistics table.

[0045] If not, record the identifier value, the structural characteristics of the corresponding execution plan, the text characteristics of the operation statement with the preset text length, and the corresponding preset statistical information in the preset statistical table.

[0046] After detecting the trigger condition for persistent storage of data stored in the circular buffer, the data stored in the circular buffer is persistently stored in a preset statistics table, thereby realizing the persistent storage of historical execution plan data and facilitating the analysis of historical trends.

[0047] In one embodiment, the database execution plan acquisition method further includes: detecting a query request for a preset performance view, returning corresponding data in a circular buffer according to the query request, and associating the preset performance view with the data stored in the circular buffer.

[0048] Specifically, this involves configuring an associated view for the data in the circular buffer, as shown in the following example: CREATE VIEW light_plan_stats AS SELECT plan_hash, query_text, plan_json, first_seen, last_seen, execution_count, total_exec_time, min_exec_time, max_exec_time, avg_exec_time, shared_buffer_hits, local_buffer_hits, (total_exec_time / execution_count) as avg_time_per_execution FROM light_plan_buffer WHERE execution_count > 0 ORDER BY total_exec_time DESC; This allows queries to be performed using the "light_plan_stats" view, greatly improving query convenience. For example, to view the most time-consuming execution plan: SELECT query_text, execution_count, avg_time_per_execution FROM light_plan_stats ORDER BY total_exec_time DESC LIMIT 10.

[0049] like Figure 3As shown, in one embodiment, the database execution plan acquisition method generally includes: Step S301: The operation statement has been completed.

[0050] Step S302: Check whether the execution time of the execution plan has reached the preset time threshold. If yes, proceed to step S303; otherwise, end the execution plan collection.

[0051] Specifically, this means checking whether the execution time of the execution plan is relatively long. Only execution plans with long execution times need to be analyzed and optimized, while execution plans with short execution times generally do not need to be analyzed and optimized, so they are not collected.

[0052] Step S303: Obtain the execution plan of the operation statement.

[0053] Step S304: Generate an identifier value based on the operation statement and execution plan using a preset algorithm.

[0054] Step S305: Detect whether there is an identifier value in the preset storage space. If yes, proceed to step S306; otherwise, proceed to step S307.

[0055] Step S306: Update the preset statistical information corresponding to the identifier value in the preset storage space.

[0056] Step S307: Store the structural features of the execution plan, the text features of the operation statements with preset text length, the identifier values, and the corresponding preset statistical information into the preset storage space.

[0057] In this embodiment, by collecting only the relevant data of execution plans whose execution time is greater than a preset time threshold, it helps to further reduce storage space usage and improve analysis efficiency.

[0058] It should be noted that steps not detailed in this embodiment are described in the preceding text with the same names.

[0059] Reference Figure 4 As shown, the method for collecting database execution plans is further explained in conjunction with the database system architecture.

[0060] Business SQL refers to the SQL statements received by the database. The SQL statements received by the database are parsed by the parser, then the optimizer generates the corresponding execution plan, the executor executes the execution plan, and finally the query result set is returned to the user.

[0061] The execution plan collector, specifically, is the hook function described above. It intelligently collects execution plans based on configuration parameters. These parameters control whether plan collection is enabled, the collection threshold (a preset time threshold to determine if an execution plan needs to be collected), the cache size (the capacity of the circular buffer), the automatic persistence interval (the time interval for persistent storage), and the query text truncation length (the length of the saved SQL text features). Once the executor completes execution, the execution plan collector extracts the original execution plan.

[0062] After generating the identifier value (see above for details), the relevant data of the execution plan is stored in the execution plan cache, i.e., the circular buffer, based on the identifier value. The circular buffer is configured with a dynamic performance view, which allows for easy viewing of the data within the circular buffer. At the automatic persistence interval, the data in the execution plan cache is transferred to the persistent execution plan history repository.

[0063] The solution of this invention, after obtaining the execution plan, stores the relevant data of the execution plan according to the identifier value, first storing it in a cache area, and then transferring it to a persistent storage area when certain conditions are met. Compared with the method of storing the execution plan in logs, the impact on database performance is significantly reduced, with I / O operations reduced by more than 90%. Furthermore, memory usage is fixed, not exceeding the configuration limit, and the impact on normal database operations is less than 1%.

[0064] Data availability is significantly improved; it stores structured data that directly supports SQL analysis. Real-time access is supported without parsing log files. Historical trend analysis capabilities are also provided. Improved operational efficiency. Disk space usage is reduced by over 95%, minimizing storage resource consumption. The execution plan analysis process is simplified, providing immediate performance insights. Database administrators save analysis time, enabling them to quickly identify performance bottlenecks, promptly detect execution plan regressions, and optimize query performance tuning. Monitoring is highly automated, reducing manual log analysis and enabling automatic historical data management.

[0065] This embodiment also provides a computer device and a computer-readable storage medium. Figure 5 This is a schematic diagram of a computer device 10 according to an embodiment of the present invention. Figure 6 This is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention.

[0066] The computer device 10 may include a memory 110, a processor 120, and a computer-executable program 11 stored on the memory 110 and running on the processor 120. When the processor 120 executes the computer-executable program 11, it implements the database execution plan acquisition method of any of the above embodiments.

[0067] A computer-readable storage medium 20 stores a computer-executable program 11 thereon, which, when executed by a processor, implements the database execution plan acquisition method of any of the above embodiments.

[0068] This embodiment also provides a computer program product. Figure 7 This is a schematic diagram of a computer program product 30 according to an embodiment of the present invention. The computer program product 30 includes a computer executable program 11, which, when executed by a processor 120, implements any of the database execution plan acquisition methods described above.

[0069] Specifically, the computer executable program 11 used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, computer instructions, computer-related instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.

[0070] For the purposes of this embodiment, the computer-readable storage medium 20 can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, the computer-readable storage medium 20 can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0071] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.

[0072] Computer device 10 can be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, computer device 10 can be a cloud acquisition node. Computer device 10 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types. Computer device 10 can be implemented in a distributed cloud acquisition environment where tasks are performed by remote processing devices linked via a communication network. In a distributed cloud acquisition environment, program modules can reside on local or remote acquisition system storage media, including storage devices.

[0073] Computer device 10 may include a processor 120 adapted to execute stored instructions and a memory 110 that provides temporary storage space for the operation of said instructions during operation. Processor 120 may be a single-core processor, a multi-core processor, an acquisition cluster, or any other configuration. Memory 110 may include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.

[0074] The processor 120 can be connected via a system interconnect (e.g., PCI, PCI-Express, etc.) to an I / O interface (input / output interface) suitable for connecting the computer device 10 to one or more I / O devices (input / output devices). I / O devices may include, for example, a keyboard and indicating devices, where indicating devices may include a touchpad or touchscreen, etc. I / O devices may be built into the computer device 10 or may be external devices connected to the acquisition device.

[0075] The processor 120 may also be linked via a system interconnect to a display interface suitable for connecting the computer device 10 to a display device. The display device may include a display screen that is a built-in component of the computer device 10. The display device may also include an external computer monitor, television, or projector connected to the computer device 10. Furthermore, a network interface controller (NIC) may be adapted to connect the computer device 10 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an Internet Minicomputer System Interface) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. Remote devices may connect to the computer device via the network.

[0076] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.

Claims

1. A method for collecting execution plans from a database, comprising: Once the execution of the operation statement is detected as complete, the execution plan of the operation statement is obtained; An identifier value is generated based on the operation statement and the execution plan using a preset algorithm; If the identifier value exists in the preset storage space, update the preset statistics information corresponding to the identifier value in the preset storage space. The preset statistics information includes the number of executions and the maximum execution time.

2. The database execution plan acquisition method according to claim 1, wherein... The step of generating an identifier value based on the operation statement and the execution plan using a preset algorithm includes: Extract the structural features of the execution plan after removing numerical parameters; Obtain the text features generated after removing the constant parameters from the operation statement; The identifier value is generated based on the structural features and the text features using the preset algorithm.

3. The database execution plan acquisition method according to claim 2, wherein... Following the step of detecting whether the identifier value exists in the preset storage space, the following is included: If not, store the structural features of the execution plan, the text features of the operation statement with a preset text length, the identifier value, and the corresponding preset statistical information into the preset storage space.

4. The database execution plan acquisition method according to claim 1, wherein... The preset storage space is a circular buffer.

5. The database execution plan acquisition method according to claim 4, wherein... If a trigger condition is detected to persist the data stored in the circular buffer, the data stored in the circular buffer will be persisted to a preset statistics table.

6. The database execution plan acquisition method according to claim 4, wherein... A query request for a preset performance view is detected, and the corresponding data in the circular buffer is returned according to the query request. The preset performance view is associated with the data stored in the circular buffer.

7. The database execution plan acquisition method according to claim 1, wherein... The step of obtaining the execution plan of the operation statement includes the following: If the execution time of the execution plan reaches a preset time threshold, then execute the step of obtaining the execution plan of the operation statement.

8. A computer device comprising a memory, a processor, and a computer-executable program stored in the memory and running on the processor, wherein the processor, when executing the computer-executable program, implements the database execution plan acquisition method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer-executable program stored thereon, the computer-executable program, when executed by a processor, implementing the database execution plan acquisition method according to any one of claims 1 to 7.

10. A computer program product comprising a computer executable program, wherein the computer executable program, when executed by a processor, implements the database execution plan acquisition method according to any one of claims 1 to 7.