Database performance analysis method and apparatus, electronic device, and medium
By determining performance parameters and building decision trees based on task phases and resource consumption dimensions, the problem of time-consuming and labor-intensive traditional database performance analysis is solved, enabling fast and efficient database performance analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CETC JINCANG (BEIJING) TECH CO LTD
- Filing Date
- 2021-12-03
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional database performance analysis methods require the analysis of multiple performance indicators, which is time-consuming and labor-intensive.
By determining the database's performance parameters in terms of task phase and resource consumption, a target decision tree is established, and time metrics are used to unify the performance parameters for analysis.
It improves the efficiency of database performance analysis, solves the problem of time-consuming and labor-intensive analysis, and enables rapid performance analysis.
Smart Images

Figure CN114253817B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of database processing, and particularly relates to a performance analysis method and device of a database, an electronic device and a medium. BACKGROUND
[0002] In recent years, with the development of new application scenarios such as mobile Internet, big data and artificial intelligence, and new hardware technologies, the database management system (DBMS) has significantly increased in scale and complexity, and the performance problem of the database has become increasingly prominent.
[0003] The performance of the database is generally measured by response time and throughput, and is affected by many factors such as concurrency, structured query language (SQL) requests and hardware resources. The implementation architecture of the database product itself is complex, and there are many modules related to performance inside (such as query optimization, query execution, shared buffer management, execution plan management or disk read / write, etc.). However, traditionally, different modules have different performance indicators (such as the indicator of the buffer is hit rate, and the indicator of the disk read / write is response time, etc.). Based on these different indicators, the traditional database analysis method mainly analyzes and compares the indicators by professional personnel to obtain the performance analysis result of the database.
[0004] The defects of the existing scheme are that multiple performance indicators need to be analyzed, which is time-consuming and has high labor cost. SUMMARY
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a performance analysis method and device of a database, an electronic device and a medium.
[0006] In a first aspect, the present disclosure provides a performance analysis method of a database, the method comprising:
[0007] determining a first performance parameter of the database in a task stage dimension; and determining a second performance parameter of the database in a resource consumption dimension;
[0008] determining a running time of the first performance parameter; and determining a running time of the second performance parameter;
[0009] establishing a target decision tree of the first performance parameter and the second performance parameter based on the running time of the first performance parameter and the running time of the second performance parameter;
[0010] determining a performance analysis result of the database according to the target decision tree.
[0011] Optionally, the determining the first performance parameter of the database in the task stage dimension comprises:
[0012] obtaining execution data responding to historical task requests of users from historical use records of the database;
[0013] determining the first performance parameter of the database in the task stage dimension according to the execution data;
[0014] wherein the first performance parameter comprises at least one of the following: a task receiving parameter, a task parsing parameter, a task optimization parameter, a task execution parameter and a result returning parameter.
[0015] Optionally, the determining the second performance parameter of the database in the resource consumption dimension comprises:
[0016] obtaining hardware processing data of historical tasks completed in the database;
[0017] determining the second performance parameter of the database in the resource consumption dimension according to the hardware processing data;
[0018] wherein the second performance parameter comprises at least one of the following: a processor running parameter, a read-write waiting parameter of the database and a concurrency waiting parameter.
[0019] Optionally, before the establishing the target decision tree of the first performance parameter and the second performance parameter, the method further comprises:
[0020] calculating a message digest value of the execution data;
[0021] associating running time of the first performance parameter with running time of the second performance parameter according to the message digest value.
[0022] Optionally, the establishing the target decision tree of the first performance parameter and the second performance parameter based on the running time of the first performance parameter and the running time of the second performance parameter comprises:
[0023] performing deep data analysis on the first performance parameter based on the running time of the first performance parameter to obtain a first sub-parameter of the first performance parameter; performing deep data analysis on the second performance parameter based on the running time of the second performance parameter to obtain a second sub-parameter of the second performance parameter;
[0024] taking the first performance parameter as a first main node and taking the first sub-parameter as a first auxiliary node; taking the second performance parameter as a second main node and taking the second sub-parameter as a second auxiliary node;
[0025] According to the first master node, the first secondary node, the second master node, the second secondary node, a target decision tree is established.
[0026] Optionally, the performance analysis result of the database is determined according to the target decision tree, including:
[0027] Parameter analysis information of the first secondary node and parameter analysis information of the second secondary node are searched from the target decision tree.
[0028] According to the parameter analysis information, and the association information of the running time of the first performance parameter and the running time of the second performance parameter, a time consumption factor of the database and a consumption reason of the time consumption factor are determined.
[0029] Optionally, after the performance analysis result of the database is determined according to the target decision tree, the method further includes:
[0030] An associated node of the time consumption factor is searched.
[0031] The time consumption factor is optimized, and an optimized quantitative value of the associated node is calculated according to an optimization result.
[0032] In a second aspect, the present disclosure further provides a database performance analysis device, including:
[0033] A parameter determination module is configured to determine a first performance parameter of a database in a task stage dimension, and determine a second performance parameter of the database in a resource consumption dimension.
[0034] A time determination module is configured to determine a running time of the first performance parameter, and determine a running time of the second performance parameter.
[0035] A decision tree establishment module is configured to establish a target decision tree of the first performance parameter and the second performance parameter based on the running time of the first performance parameter and the running time of the second performance parameter.
[0036] A performance analysis module is configured to determine a performance analysis result of the database according to the target decision tree.
[0037] Optionally, the parameter determination module is specifically configured to:
[0038] Execution data responding to a task request of a historical user is obtained from a historical use record of the database.
[0039] The first performance parameter of the database in the task stage dimension is determined according to the execution data.
[0040] The first performance parameter comprises at least one of a task receiving parameter, a task analysis parameter, a task optimization parameter, a task execution parameter and a result returning parameter.
[0041] Optionally, the parameter determination module is specifically configured to:
[0042] Based on the completed historical tasks in the database, hardware processing data of the historical tasks is obtained.
[0043] According to the hardware processing data, a second performance parameter of the database in a resource consumption dimension is determined.
[0044] The second performance parameter comprises at least one of a processor running parameter, a read-write waiting parameter of the database and a concurrency waiting parameter.
[0045] Optionally, the method further comprises:
[0046] A message digest value calculation module is configured to calculate a message digest value of the execution data.
[0047] A time correlation module is configured to correlate a running time of the first performance parameter and a running time of the second performance parameter according to the message digest value.
[0048] Optionally, the method further comprises:
[0049] Based on the running time of the first performance parameter, a depth data analysis is performed on the first performance parameter to obtain a first sub-parameter of the first performance parameter; and based on the running time of the second performance parameter, a depth data analysis is performed on the second performance parameter to obtain a second sub-parameter of the second performance parameter.
[0050] The first performance parameter is taken as a first main node, and the first sub-parameter is taken as a first auxiliary node; the second performance parameter is taken as a second main node, and the second sub-parameter is taken as a second auxiliary node.
[0051] According to the first main node, the first auxiliary node, the second main node and the second auxiliary node, a target decision tree is established.
[0052] Optionally, the method further comprises:
[0053] From the target decision tree, parameter analysis information of the first auxiliary node and parameter analysis information of the second auxiliary node are searched.
[0054] According to the parameter analysis information and the correlation information of the running time of the first performance parameter and the running time of the second performance parameter, a time consumption factor of the database and a consumption reason of the time consumption factor are determined.
[0055] Optionally, further comprising:
[0056] a node searching module, configured to search an associated node of the time consumption factor;
[0057] a quantitative value calculating module, configured to perform optimization processing on the time consumption factor, and calculate an optimized quantitative value of the associated node according to a result of the optimization processing.
[0058] In a third aspect, the present disclosure provides an electronic device, which comprises:
[0059] one or more processors;
[0060] a storage device, configured to store one or more programs,
[0061] when the one or more programs are executed by the one or more processors, the one or more processors implement the database performance analysis method in any of the embodiments of the present disclosure.
[0062] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the database performance analysis method in any of the embodiments of the present disclosure.
[0063] The technical solution provided by the embodiments of the present disclosure has the following advantages compared with the prior art: the performance parameters of the database are unified by using the time index, the performance of the database is quickly quantified, the problem that a lot of indexes need to be processed respectively and thus time and effort are consumed is solved, and thus the performance analysis efficiency of the database is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure together with the specification.
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
[0066] Figure 1 is a flowchart of a database performance analysis method provided by the embodiments of the present disclosure;
[0067] Figure 2 is a flowchart of another database performance analysis method provided by the embodiments of the present disclosure;
[0068] Figure 3 is a structural schematic diagram of an initial decision tree;
[0069] Figure 4 is a structural schematic diagram of a target decision tree;
[0070] Figure 5 is a flowchart of another database performance analysis method provided by an embodiment of the present disclosure;
[0071] Figure 6 is a structural schematic diagram of a database performance analysis apparatus provided by an embodiment of the present disclosure;
[0072] Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0073] In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0074] In the following description, many specific details are set forth in order to fully understand the present disclosure, but the present disclosure can also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some of the embodiments of the present disclosure, not all the embodiments.
[0075] Figure 1 is a flowchart of a database performance analysis method provided by an embodiment of the present disclosure. The present embodiment can be applicable to the case of analyzing the performance of a database by using time indicators. The present embodiment method can be executed by a database performance analysis apparatus, which can be implemented in a hardware / software manner and can be configured in an electronic device. The database performance analysis method described in any embodiment of the present application can be implemented.
[0076] In the present embodiment, the performance parameters of the database to be analyzed are divided into two dimensions, namely a task stage dimension and a resource consumption dimension; wherein the task stage dimension is the parameter used by the user using the database in each stage of processing the foreground request (such as SQL request); the resource consumption dimension is the parameter generated by the user using the database during use or waiting for various software and hardware resources to respond.
[0077] Since there are many performance indicators for evaluating the database, it takes a long time and manpower to analyze the performance of the database; in order to unify the performance analysis indicators of the database, the present embodiment uses the time indicators of the parameters under different dimensions as the only analysis indicators of the database, so as to improve the performance analysis efficiency of the database.
[0078] AsFigure 1 As shown, the method specifically comprises the following:
[0079] S110, determining a first performance parameter of the database in a task stage dimension, and determining a second performance parameter of the database in a resource consumption dimension.
[0080] In the embodiment, the first performance parameter is an execution parameter generated by the database in response to each stage of the user's execution task, and the second performance parameter is an interaction parameter generated by the user's interaction with the software and hardware resources. Wherein, when the user sends a task processing request to the database, the user usually uses a SQL request to access data, query, update or manage a relational database system in the database, etc.
[0081] Specifically, the first performance parameter can include a task receiving parameter, a task parsing parameter, a task optimization parameter, a task execution parameter or a result returning parameter; and the second performance parameter can include a processor running parameter, a database read-write waiting parameter or a concurrency waiting parameter.
[0082] It should be noted that when the first performance parameter and the second performance parameter are determined, different task scenarios can be added, deleted or selected, and the embodiment does not make specific limitation.
[0083] S120, determining a running time of the first performance parameter, and determining a running time of the second performance parameter.
[0084] In the embodiment, the running time of the first performance parameter is the database time spent in each stage in response to the user's task request, and the running time of the second performance parameter is the database time spent in each execution of the software and hardware in the user's task request.
[0085] For example, the running time of the first performance parameter can include a task receiving time, a task parsing time, a task optimization time, a task execution time or a result returning time; and the running time of the second performance parameter can include a processor running time, a database read-write waiting time or a concurrency waiting time. Wherein, the concurrency waiting time is the waiting time between when a user wants to write data into the database, but at the current time, there is already someone performing data writing operation in the database and the writing operation has not been completed, and when the user can perform the writing operation after the previous user's writing operation is completed.
[0086] S130, based on the running time of the first performance parameter and the running time of the second performance parameter, establishing a target decision tree of the first performance parameter and the second performance parameter.
[0087] In this embodiment, the first performance parameter and the second performance parameter are used as nodes of different dimensions, and child nodes under different performance parameters are generated, thereby constructing a target decision tree with the database time index as a unified metric; this enables effective analysis of the performance parameters in the database task processing process.
[0088] S140. Determine the database performance analysis results based on the target decision tree.
[0089] In this embodiment, the upper-level nodes of the target decision tree can be used to identify the amount of time consumed, and the lower-level nodes can locate the root cause of the database performance problem through the time distribution and the correlation between the running time of the first performance parameter and the running time of the second performance parameter, so as to effectively analyze the database performance.
[0090] This disclosure embodiment determines a first performance parameter of the database under the task phase dimension; and a second performance parameter of the database under the resource consumption dimension; determines the runtime of the first performance parameter; determines the runtime of the second performance parameter; establishes a target decision tree for the first and second performance parameters based on the runtime of the first and second performance parameters; and determines the database performance analysis result based on the target decision tree. This disclosure embodiment can unify the database performance parameters using time indicators, enabling rapid measurement of database performance, solving the problem of time-consuming and laborious processing of numerous indicators separately, thereby effectively improving the efficiency of database performance analysis.
[0091] Figure 2 This is a flowchart illustrating another database performance analysis method provided in this disclosure. This embodiment is a further extension and optimization based on the above embodiments, and can be combined with any optional solution in the above technical solutions. Figure 2 As shown, the method includes:
[0092] S210. Obtain the execution data of the task requests in response to historical users from the historical usage records of the database; determine the first performance parameter of the database in the task stage dimension based on the execution data.
[0093] The first performance parameter includes at least one of the following: task receiving parameters, task parsing parameters, task optimization parameters, task execution parameters, and result return parameters.
[0094] In this embodiment, the database records the task execution data of different users in its historical usage records, so that the historical task execution data can be effectively traced in the future.
[0095] Specifically, for each execution task, taking an SQL statement as an example, a query identity document (Query ID) is calculated after parameterization. This query identity can be identified using a hash algorithm to calculate its message digest value. In the database, for the same type of statement, a record can be accumulated. This record information may include: query identity, total execution time and total number of executions, parsing time and number of executions, optimization time and number of executions, and execution time and number of executions. The total execution time equals the parsing time plus the optimization time plus the execution time.
[0096] S220. Based on the historical tasks already completed in the database, obtain the hardware processing data of the historical tasks; based on the hardware processing data, determine the second performance parameter of the database in terms of resource consumption.
[0097] The second performance parameter includes at least one of the following: processor operating parameters, database read / write wait parameters, and concurrency wait parameters.
[0098] In this embodiment, read-write wait parameters and concurrent wait parameters are recorded according to the query identifier and wait type of a statement. The recorded information may include: query identifier, wait event name, total wait time and total number of times.
[0099] S230. Based on the running time of the first performance parameter, perform in-depth data analysis on the first performance parameter to obtain the first sub-parameter of the first performance parameter; based on the running time of the second performance parameter, perform in-depth data analysis on the second performance parameter to obtain the second sub-parameter of the second performance parameter.
[0100] like Figure 3 As shown, Figure 3 This is a schematic diagram of the initial decision tree structure provided in this embodiment; wherein, the database time is divided into performance parameters under two dimensions; the resource consumption dimension may include three performance parameters, namely CPU (processor running parameters), IO wait (database read and write wait parameters), and concurrency wait (concurrency wait parameters); the task stage dimension may include five performance parameters, namely returned data (result return parameters), received statement (task receiving parameters), SQL analysis (task parsing parameters), SQL plan (task optimization parameters), and SQL execution (task execution parameters); Figure 3 An initial decision tree is built based on the runtime of the first performance parameter and the runtime of the second performance parameter.
[0101] When more in-depth information is needed, it is necessary to conduct in-depth analysis of the first and second performance parameters to extend the tree nodes of the initial decision tree, so that the constructed target decision tree can more clearly and intuitively display the performance analysis results of the database.
[0102] S240, taking the first performance parameter as a first primary node and taking the first sub parameter as a first secondary node; taking the second performance parameter as a second primary node and taking the second sub parameter as a second secondary node; and establishing a target decision tree according to the first primary node, the first secondary node, the second primary node and the second secondary node.
[0103] As shown in Figure 4 , FIG. 1 is a structural diagram of the target decision tree; the target decision tree can be used to diagnose and analyze performance problems of a database. Figure 4
[0104] Specifically, in the SQL execution of the first primary node, further division can be performed, and the first secondary node can be obtained by the division, and can include SQL1 (no waiting time), SQL2 (with physical read waiting time) and SQL3 (with tuple read time); wherein, the tuple is a storage structure of stored data. In the SQL execution of the second primary node, the second secondary node, SQL1 and SQL2 can be included, and the second secondary node table sequential scanning can be obtained by further analyzing SQL1.
[0105] It should be noted that all nodes under the primary node in the embodiment are referred to as secondary nodes, that is, the first primary node can be divided into first secondary nodes of different levels, and the second primary node can be divided into second secondary nodes of different levels.
[0106] The embodiment can obtain first secondary nodes and second secondary nodes of deeper levels by deeply analyzing the first primary node and the second primary node, so as to establish a target decision tree with higher precision, and realize efficient analysis of database performance.
[0107] S250, searching for parameter analysis information of the first secondary node and parameter analysis information of the second secondary node from the target decision tree.
[0108] In the embodiment, the parameter analysis information of the first secondary node is first information capable of representing database time consumption obtained by deeply analyzing data of the first secondary node; and the parameter analysis information of the second secondary node is second information capable of representing database time consumption obtained by deeply analyzing data of the second secondary node. Wherein, the first information corresponds to the first performance parameter, and the second information corresponds to the second performance parameter.
[0109] S260, determining a time consumption factor of the database and a consumption reason of the time consumption factor according to the parameter analysis information and associated information of a running time of the first performance parameter and a running time of the second performance parameter.
[0110] In the embodiment, the associated information of the running time of the first performance parameter and the running time of the second performance parameter is a query identifier of an execution task.
[0111] According to the parameter analysis information, the running time of the secondary node corresponding to the parameter analysis information is searched from the target decision tree, and according to the running time of each secondary node, the time consumption factor of the database and the consumption reason of the time consumption factor can be effectively determined. The running time of the secondary node is obtained by the proportion of the secondary node at the same level.
[0112] Exemplarily, the target decision tree shown in FIG. 8 is taken as an example for description. Figure 4 Exemplarily, the target decision tree shown in FIG. 8 is taken as an example for description.
[0113] The parameter analysis information is "table sequential scanning" and "SQL2 accesses table B and shared memory is not enough"; wherein, the second secondary node corresponding to "table sequential scanning" is SQL execution, and the second primary node corresponding to SQL execution is CPU; the second secondary node corresponding to "SQL2 accesses table B and shared memory is not enough" is data physical read waiting, and the second primary node corresponding to data physical read waiting is IO waiting; at this time, it is assumed that the proportion of the first primary node under the resource consumption dimension is: CPU (0.5), IO waiting (0.3) and concurrent waiting (0.2), and the proportion of the second secondary node of CPU is: SQL execution (0.3), SQL1 (0.5), and the proportion of the second secondary node of IO waiting is: data physical read waiting (0.1); then the consumption time proportion value of "table sequential scanning" can be obtained: 0.5x0.3x0.5=0.075; the consumption time proportion value of "SQL2 accesses table B and shared memory is not enough" is: 0.1x0.3=0.04; then it can be obtained that the time consumption factor is "table B", and the consumption reason of the time consumption factor is that SQL2 accesses table B and shared memory is not enough.
[0114] Figure 5 FIG. 9 is a flow diagram of another database performance analysis method provided by the embodiments of the present disclosure. The embodiment is further extended and optimized on the basis of the above-mentioned embodiments, and can be combined with any optional scheme in the above-mentioned technical solutions. As shown in FIG. 9, the method comprises the following steps. Figure 3
[0115] S510, determining a first performance parameter of the database in a task stage dimension, and determining a second performance parameter of the database in a resource consumption dimension.
[0116] S520, determining a running time of the first performance parameter; and determining a running time of the second performance parameter.
[0117] S530, performing deep data analysis on the first performance parameter based on the running time of the first performance parameter, to obtain a first sub-parameter of the first performance parameter; and performing deep data analysis on the second performance parameter based on the running time of the second performance parameter, to obtain a second sub-parameter of the second performance parameter.
[0118] S540, calculating a message digest value of the execution data; and associating the running time of the first performance parameter and the running time of the second performance parameter according to the message digest value.
[0119] In this embodiment, the message digest value can be calculated according to a hash algorithm. The running time of the first performance parameter and the running time of the second performance parameter are associated, which is to correspond and associate the running time of the first performance parameter and the running time of the second performance parameter under the same execution data, so as to ensure the unique correspondence of each node in the decision tree.
[0120] S550, taking the first performance parameter as a first primary node and taking the first sub-parameter as a first secondary node; taking the second performance parameter as a second primary node and taking the second sub-parameter as a second secondary node; and establishing a target decision tree according to the first primary node, the first secondary node, the second primary node and the second secondary node.
[0121] S560, searching for parameter analysis information of the first secondary node and parameter analysis information of the second secondary node from the target decision tree; and determining a time consumption factor of the database and a consumption reason of the time consumption factor according to the parameter analysis information and the association information of the running time of the first performance parameter and the running time of the second performance parameter.
[0122] S570, searching for an associated node of the time consumption factor.
[0123] In this embodiment, the last first secondary node or the last second secondary node associated with the time consumption factor is the associated node.
[0124] S580, optimizing the time consumption factor and calculating an optimized quantitative value of the associated node according to an optimization result.
[0125] In this embodiment, after locating the root cause of the database, the performance influence of the associated node is optimized to shorten the response data of the database under the performance parameter, so as to shorten the database time and effectively improve the throughput of the database. The optimized quantitative value of the associated node can be determined according to the ratio of the difference between the time before optimization and the time after optimization to the time before optimization.
[0126] Figure 6 is a structural schematic diagram of a performance analysis device of a database provided by an embodiment of the present disclosure; the device is configured in an electronic equipment and can implement the performance analysis method of the database according to any embodiment of the present application. The device specifically includes the following:
[0127] The parameter determination module 610 is configured to determine a first performance parameter of the database in a task stage dimension, and determine a second performance parameter of the database in a resource consumption dimension.
[0128] The time determining module 620 is configured to determine a running time of the first performance parameter; and determine a running time of the second performance parameter.
[0129] The decision tree establishing module 630 is configured to establish a target decision tree of the first performance parameter and the second performance parameter based on the running time of the first performance parameter and the running time of the second performance parameter.
[0130] The performance analysis module 640 is configured to determine a performance analysis result of the database according to the target decision tree.
[0131] In this embodiment, the parameter determining module 610 is configured to:
[0132] obtain execution data responding to a task request of a historical user from a historical use record of the database;
[0133] determine a first performance parameter of the database in a task stage dimension according to the execution data;
[0134] The first performance parameter includes at least one of a task receiving parameter, a task analysis parameter, a task optimization parameter, a task execution parameter and a result returning parameter.
[0135] In this embodiment, the parameter determining module 610 is configured to:
[0136] obtain hardware processing data of a historical task based on the historical task completed in the database;
[0137] determine a second performance parameter of the database in a resource consumption dimension according to the hardware processing data;
[0138] The second performance parameter includes at least one of a processor running parameter, a read-write waiting parameter of the database and a concurrency waiting parameter.
[0139] In this embodiment, the device further includes:
[0140] The message digest value calculating module is configured to calculate a message digest value of the execution data;
[0141] The time correlating module is configured to correlate the running time of the first performance parameter and the running time of the second performance parameter according to the message digest value.
[0142] In this embodiment, the decision tree establishing module 630 is configured to:
[0143] perform deep data analysis on the first performance parameter based on the running time of the first performance parameter to obtain a first sub-parameter of the first performance parameter; and perform deep data analysis on the second performance parameter based on the running time of the second performance parameter to obtain a second sub-parameter of the second performance parameter;
[0144] take the first performance parameter as a first master node and take the first sub-parameter as a first auxiliary node; and take the second performance parameter as a second master node and take the second sub-parameter as a second auxiliary node;
[0145] establish a target decision tree according to the first master node, the first auxiliary node, the second master node, and the second auxiliary node.
[0146] In this embodiment, the performance analysis module 640, specifically, is configured to:
[0147] find parameter analysis information of the first auxiliary node and parameter analysis information of the second auxiliary node from the target decision tree;
[0148] determine a time consumption factor of the database and a consumption reason of the time consumption factor according to the parameter analysis information and associated information of the running time of the first performance parameter and the running time of the second performance parameter.
[0149] In this embodiment, the device further includes:
[0150] a node searching module configured to search for an associated node of the time consumption factor;
[0151] a quantitative value calculation module configured to perform optimization processing on the time consumption factor and calculate an optimized quantitative value of the associated node according to an optimization processing result.
[0152] The database performance analysis device provided by the embodiment can use time indicators to unify performance parameters of a database and quickly evaluate the performance of the database, thereby effectively improving the performance analysis efficiency of the database.
[0153] The database performance analysis device provided by the embodiment can execute the database performance analysis method provided by any of the embodiments of the present application and has the corresponding function modules and beneficial effects of the execution method.
[0154] Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. Figure 7As shown, the electronic device includes a processor 710, a memory 720, an input device 730, and an output device 740; the number of processors 710 in the electronic device can be one or more, Figure 7 The processor 710 in the electronic device is taken as an example in this embodiment of the present application; the processor 710, the memory 720, the input device 730, and the output device 740 in the electronic device can be connected through a bus or other means, Figure 7 The connection through the bus is taken as an example in this embodiment of the present application.
[0155] The memory 720, as a kind of computer readable storage medium, can be used to store software programs, computer executable programs, and modules, such as program instructions / modules corresponding to the performance analysis method of the database in the embodiment of the present application. The processor 710 performs various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 720, that is, implements the performance analysis method of the database provided by the embodiment of the present application.
[0156] The memory 720 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and application programs required by at least one function; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory 720 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some examples, the memory 720 can further include a memory remotely arranged with respect to the processor 710, which can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0157] The input device 730 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device, and can include a keyboard, a mouse, etc. The output device 740 can include a display device such as a display screen.
[0158] The embodiment of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the performance analysis method of the database provided by the embodiment of the present application.
[0159] Of course, the storage medium containing computer executable instructions provided by the embodiment of the present application is not limited to the method operations as described above, and can also perform related operations in the performance analysis method of the database provided by any embodiment of the present application.
[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary universal hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product can be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH, a hard disk, or an optical disc, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0161] It is worth noting that in the above embodiments of the search device, each unit and module included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy mutual distinction, and do not limit the protection scope of the present application.
[0162] It should be noted that in this paper, relationship terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the sentence "including a…" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0163] The above description is only a specific embodiment of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method of performance analysis of a database, characterized by, The method comprises: determining a first performance parameter of the database in a task stage dimension; and determining a second performance parameter of the database in a resource consumption dimension; determining a running time of the first performance parameter; determining a running time of the second performance parameter; based on the running time of the first performance parameter and the running time of the second performance parameter, establishing a target decision tree of the first performance parameter and the second performance parameter; determining a performance analysis result of the database according to the target decision tree; wherein, before the establishment of the target decision tree of the first performance parameter and the second performance parameter, the method further comprises: calculating a message digest value of execution data of responding to a historical user task request from historical use records of the database, the message digest value as a query identifier corresponding to the same task; according to the query identifier, associating the running time of the first performance parameter and the running time of the second performance parameter under the same task; wherein, the establishment of the target decision tree of the first performance parameter and the second performance parameter based on the running time of the first performance parameter and the running time of the second performance parameter comprises: based on the running time of the first performance parameter, performing deep data analysis on the first performance parameter to obtain a first sub parameter of the first performance parameter; based on the running time of the second performance parameter, performing deep data analysis on the second performance parameter to obtain a second sub parameter of the second performance parameter; taking the first performance parameter as a first main node and the first sub parameter as a first auxiliary node; taking the second performance parameter as a second main node and the second sub parameter as a second auxiliary node; establishing a target decision tree according to the first main node, the first auxiliary node, the second main node and the second auxiliary node.
2. The method of claim 1, wherein, The determination of the first performance parameter of the database in the task stage dimension comprises: obtaining execution data responding to historical user task requests from historical use records of the database; determining the first performance parameter of the database in the task stage dimension according to the execution data; wherein, the first performance parameter comprises at least one of the following: task receiving parameter, task analysis parameter, task optimization parameter, task execution parameter and result return parameter.
3. The method of claim 1, wherein, The determination of the second performance parameter of the database in the resource consumption dimension comprises: based on the completed historical tasks in the database, obtaining hardware processing data of the historical tasks; determining the second performance parameter of the database in the resource consumption dimension according to the hardware processing data; wherein, the second performance parameter comprises at least one of the following: processor running parameter, read-write waiting parameter and concurrent waiting parameter of the database.
4. The method of claim 1, wherein, The determination of the performance analysis result of the database according to the target decision tree comprises: finding parameter analysis information of the first auxiliary node and parameter analysis information of the second auxiliary node from the target decision tree; According to the parameter analysis information and the association information of the running time of the first performance parameter and the running time of the second performance parameter, a time consumption factor of the database and a consumption reason of the time consumption factor are determined.
5. The method of claim 1, wherein, After the performance analysis result of the database is determined according to the target decision tree, the method further comprises: searching for an associated node of the time consumption factor; optimizing the time consumption factor and calculating an optimized quantization value of the associated node according to an optimization result.
6. A performance analysis apparatus of a database, characterized by comprising: The device comprises: a parameter determination module configured to determine a first performance parameter of a database in a task stage dimension, and determine a second performance parameter of the database in a resource consumption dimension; a time determination module configured to determine a running time of the first performance parameter, and determine a running time of the second performance parameter; a decision tree establishment module configured to establish a target decision tree of the first performance parameter and the second performance parameter based on the running time of the first performance parameter and the running time of the second performance parameter; a performance analysis module configured to determine a performance analysis result of the database according to the target decision tree; The device further comprises: a message digest value calculation module configured to calculate a message digest value of execution data of a response historical user task request obtained from a historical use record of a database, the message digest value serving as a query identifier corresponding to a same task; a time association module configured to associate the running time of the first performance parameter and the running time of the second performance parameter under the same task according to the query identifier; The decision tree establishment module is specifically configured to: perform deep data analysis on the first performance parameter based on the running time of the first performance parameter to obtain a first sub-parameter of the first performance parameter, and perform deep data analysis on the second performance parameter based on the running time of the second performance parameter to obtain a second sub-parameter of the second performance parameter; take the first performance parameter as a first main node and take the first sub-parameter as a first auxiliary node, and take the second performance parameter as a second main node and take the second sub-parameter as a second auxiliary node; establish a target decision tree according to the first main node, the first auxiliary node, the second main node and the second auxiliary node.
7. An electronic device, comprising: comprise: one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the performance analysis method of the database according to any one of claims 1-5.
8. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the performance analysis method of the database according to any one of claims 1-5.
Citation Information
Patent Citations
Method, apparatus and device for monitoring database performance indexes, and computer readable storage medium
CN107908533A
Performance abnormality analysis apparatus, method, and program, and analysis result display method for performance abnormality analysis apparatus
US20090048807A1