CN109240901B - Performance analysis method, performance analysis device, storage medium, and electronic apparatus - Google Patents

Performance analysis method, performance analysis device, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN109240901B
CN109240901B CN201810988624.7A CN201810988624A CN109240901B CN 109240901 B CN109240901 B CN 109240901B CN 201810988624 A CN201810988624 A CN 201810988624A CN 109240901 B CN109240901 B CN 109240901B
Authority
CN
China
Prior art keywords
database query
statement
query statement
execution plan
performance evaluation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810988624.7A
Other languages
Chinese (zh)
Other versions
CN109240901A (en
Inventor
姜彦国
徐俊劲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xingxuan Technology Co Ltd
Original Assignee
Beijing Xingxuan Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xingxuan Technology Co Ltd filed Critical Beijing Xingxuan Technology Co Ltd
Priority to CN201810988624.7A priority Critical patent/CN109240901B/en
Publication of CN109240901A publication Critical patent/CN109240901A/en
Application granted granted Critical
Publication of CN109240901B publication Critical patent/CN109240901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment

Abstract

A performance analysis method, a performance analysis apparatus, a storage medium, and an electronic device are disclosed. According to the embodiment of the invention, the performance evaluation result of the database query statement is obtained according to the execution plan of the database query statement generated by obtaining the database query statement template and the parameters of part or all of the execution plan, so that the database query statement template is marked according to the performance evaluation result. Therefore, the performance of the database query statement template can be evaluated more accurately before the database query statement template is on-line.

Description

Performance analysis method, performance analysis device, storage medium, and electronic apparatus
Technical Field
The invention relates to the technical field of databases, in particular to a performance analysis method, a corresponding device, a storage medium and electronic equipment.
Background
With the rapid development of computer technology, internet platforms are increasingly used. The increasing number of users and kinds of data put high demands on the database operation performance of the internet platform. The client program can convert the operation of the user into a database query statement, and then access the data. The client program will typically generate a specific database query statement based on a predetermined database query statement template. The operation of a database by a database query statement, such as which table was used in the query, which operations were performed on the data, etc., is commonly referred to as an execution plan.
In the prior art, the performance of the execution plan of the database query statement is usually evaluated in a manual mode, so that the evaluation efficiency is low, the labor cost is high, and errors are easily generated in a performance evaluation result. And the potential risk and performance of the database query statement template cannot be effectively analyzed in a manual mode.
Disclosure of Invention
In view of this, embodiments of the present invention provide a performance analysis method, a performance analysis apparatus, a storage medium, and an electronic device, which are used to evaluate the performance of a database query statement template for generating a database query statement, and provide data support for optimizing and evaluating the performance of the database query statement template.
According to a first aspect of embodiments of the present invention, there is provided a performance analysis method, including:
generating a corresponding database query statement according to the database query statement template;
acquiring an execution plan of the database query statement;
obtaining a performance evaluation result of the database query statement according to partial or all execution plan parameters of the execution plan; and
and marking the database query statement template according to the performance evaluation result.
Preferably, generating the corresponding database query statement according to the database query statement template includes:
generating a plurality of groups of template parameters of the database query statement template in a preset mode; and
and generating a plurality of database query sentences according to the database query sentence template and the template parameters.
Preferably, obtaining the execution plan of the database query statement comprises:
respectively acquiring an execution plan of each database query statement; or
And acquiring an execution plan of part of the database query statement.
Preferably, the obtaining the performance evaluation result of the database query statement according to the parameters of part or all of the execution plan comprises:
and acquiring a performance evaluation result of the database query statement according to part or all of the execution plan parameters of the execution plan and a preset scoring standard.
Preferably, the execution plan parameters include a number of the database query statement;
the predetermined scoring criteria causes the database query statement whose number satisfies the first condition to have a worse performance evaluation result.
Preferably, the execution plan parameters include a type of the database query statement;
the predetermined scoring criteria causes the database query statement of the type satisfying the second condition to have a worse performance evaluation result.
Preferably, the execution plan parameters include a table used by the database query statement query;
the predetermined scoring criteria causes database query statements whose tables satisfy a third condition to have worse performance evaluation results.
Preferably, the execution plan parameters include a connection type used by the database query statement query;
the predetermined scoring criteria causes database query statements whose connection type satisfies a fourth condition to have worse performance evaluation results.
Preferably, the execution plan parameters include an index that is available for the database query statement to query;
the predetermined scoring criteria causes the database query statements whose available index satisfies the fifth condition to have worse performance evaluation results.
Preferably, the execution plan parameters include an index selected for use by the database query statement in querying;
the predetermined scoring criteria causes the database query statement whose index used by the selection satisfies the sixth condition to have a worse performance evaluation result.
Preferably, the execution plan parameters include the number of rows that the database query statement affects a database;
the predetermined scoring criteria causes database query statements having the row number satisfying a seventh condition to have poorer performance evaluation results.
Preferably, the execution plan parameters include additional information of the database query statement;
the predetermined scoring criterion is such that database query statements whose additional information satisfies the eighth condition have worse performance evaluation results.
Preferably, the method further comprises:
and when the type of the database query statement is a non-selection type, converting the non-selection type database query statement into a selection type statement.
Preferably, the obtaining the performance evaluation result of the database query statement according to the parameters of part or all of the execution plan comprises:
inputting part or all of the execution plan parameters of the execution plan of the database query statement into a classification model to obtain a performance evaluation result of the database query statement, wherein the classification model is obtained by pre-training a performance evaluation sample, and the performance evaluation sample comprises the database query statement and a corresponding performance evaluation result.
Preferably, the performance evaluation result of the performance evaluation sample is obtained by acquiring an input score; or
And the performance evaluation result of the database query performance evaluation sample is obtained by performing log analysis on a database query statement.
Preferably, marking the database query statement template according to the performance evaluation result comprises:
and in response to the performance analysis results of the database query statement of a preset number or a preset proportion meet a ninth condition, marking the corresponding database query statement template as a potential low-performance template.
According to a second aspect of embodiments of the present invention, there is provided a performance analysis apparatus, the apparatus comprising:
the sentence acquisition unit is used for generating a corresponding database query sentence according to the database query sentence template;
the statement processing unit is used for acquiring an execution plan of the database query statement;
the statement evaluation unit is used for acquiring a performance evaluation result of the database query statement according to part or all of the execution plan parameters of the execution plan;
and the marking unit is used for marking the database query statement template according to the performance evaluation result.
Preferably, the sentence acquisition unit includes:
the parameter generation subunit is used for generating a plurality of groups of template parameters of the database query statement template in a preset mode; and
and the statement generation subunit is used for generating a plurality of SQL statements according to the database query statement template and the template parameters.
Preferably, the statement processing unit is configured to obtain an execution plan of each database query statement, or obtain an execution plan of a part of the database query statements, respectively.
Preferably, the statement evaluation unit is configured to obtain a performance evaluation result of the database query statement according to a part or all of the execution plan parameters of the execution plan and a predetermined scoring criterion.
Preferably, the execution plan parameters include a number of the database query statement;
the statement evaluation unit is used for enabling the database query statement with the number meeting the first condition to have a worse performance evaluation result according to the preset scoring standard.
Preferably, the execution plan parameters include a type of the database query statement;
the statement evaluation unit is used for enabling the database query statement of which the type meets the second condition to have worse performance evaluation results according to the preset scoring standard.
Preferably, the execution plan parameters include a table used by the database query statement query;
the statement evaluation unit is used for enabling the database query statement of which the table meets the third condition to have worse performance evaluation results according to the preset scoring standard.
Preferably, the execution plan parameters include a connection type used by the database query statement query;
the statement evaluation unit is used for enabling the database query statement of which the connection type meets the fourth condition to have a worse performance evaluation result according to the preset scoring standard.
Preferably, the execution plan parameters include an index that the database query statement is available at query time;
the statement evaluation unit is configured to make the database query statement with the available index satisfying the fifth condition have worse performance evaluation results according to the predetermined scoring criterion.
Preferably, the partial or all execution plan parameters include an index selected to be used by the database query statement during query;
the statement evaluation unit is used for enabling the selected database query statement with the index meeting the sixth condition to have worse performance evaluation results according to the preset scoring standard.
Preferably, the execution plan parameters include the number of rows that the database query statement affects the database;
the statement evaluation unit is configured to make the database query statement with the row number satisfying a seventh condition have a worse performance evaluation result according to the predetermined scoring criterion.
Preferably, the execution plan parameters include additional information of the database query statement;
the statement evaluation unit is configured to make the database query statement with the additional information satisfying the eighth condition have a worse performance evaluation result according to the predetermined scoring criterion.
Preferably, the apparatus further comprises:
and the statement conversion unit is used for converting the database query statement of the non-selection type into a statement of the selection type when the type of the database query statement is the non-selection type.
Preferably, the statement evaluation unit is configured to input a part of or all of the execution plan parameters of the execution plan of the database query statement into a classification model to obtain a performance evaluation result of the database query statement, where the classification model is obtained by pre-training a performance evaluation sample, and the performance evaluation sample includes the database query statement and a corresponding performance evaluation result.
Preferably, the performance evaluation result of the performance evaluation sample is obtained by obtaining an input score; or
And the performance evaluation result of the database query performance evaluation sample is obtained by performing log analysis on a database query statement.
Preferably, the marking unit is configured to mark the corresponding database query statement template as a potential low-performance template in response to that a predetermined number or a predetermined proportion of the performance analysis results of the database query statements satisfy a ninth condition.
According to a third aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method according to the first aspect.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to the first aspect.
According to the embodiment of the invention, the performance evaluation result of the database query statement is obtained according to the execution plan of the database query statement generated according to the database query statement template and the parameters of part or all of the execution plan, so that the database query statement template is marked according to the performance evaluation result. Therefore, the performance of the database query statement template can be evaluated more accurately before the database query statement template is online.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of a method of performance analysis of an embodiment of the present invention;
FIG. 2 is a flow diagram of a method of generating an SQL statement according to an embodiment of the invention;
3-5 are exemplary diagrams of execution plans for SQL statements in embodiments of the invention;
FIG. 6 is a schematic diagram of an execution plan parameter id and a predetermined scoring criterion in an alternative implementation of an embodiment of the present invention;
FIG. 7 is a diagram of an implementation plan parameter select _ type and predetermined scoring criteria in an alternative implementation of an embodiment of the invention;
FIG. 8 is a diagram illustrating an execution plan parameter table and predetermined scoring criteria in an alternative implementation of an embodiment of the present invention;
FIG. 9 is a diagram of execution plan parameter type and predetermined scoring criteria in an alternative implementation of an embodiment of the present invention;
FIG. 10 is a diagram illustrating an execution plan parameter posable _ keys and predetermined scoring criteria in an alternative implementation of an embodiment of the invention;
FIG. 11 is a diagram of an execution plan parameter key and predetermined scoring criteria in an alternative implementation of an embodiment of the invention;
FIG. 12 is a diagram of the execution plan parameters rows and predetermined scoring criteria in an alternative implementation of an embodiment of the invention;
FIG. 13 is a schematic diagram of execution plan parameters extra and predetermined scoring criteria in an alternative implementation of an embodiment of the invention;
FIG. 14 is a schematic diagram of a performance evaluation device of an embodiment of the present invention;
FIG. 15 is a schematic view of an electronic device of an embodiment of the invention;
FIG. 16 is a schematic interface diagram of a performance assessment application according to an embodiment of the present invention.
Detailed Description
The present disclosure is described below based on examples, but the present disclosure is not limited to only these examples. In the following detailed description of the present disclosure, certain specific details are set forth. It will be apparent to those skilled in the art that the present disclosure may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present disclosure.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including but not limited to".
In the description of the present disclosure, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present disclosure, "a plurality" means two or more unless otherwise specified.
FIG. 1 is a flow chart of a method of performance analysis of an embodiment of the present invention. In the embodiment of the invention, the database query statement template is an SQL statement template, and the database query statement is an SQL statement. It should be understood that the database query statement and the database query statement template are not limited to the SQL statement and the SQL statement template, and the method of the embodiment of the present invention may be used to perform performance analysis on other database query statements and corresponding statement templates. In this embodiment, a description will be given by taking a performance analysis process for an SQL (Structured Query Language) statement template as an example. When a user initiates a database access request (i.e., performs a query operation) through SQL in an internet platform, the system generates an SQL statement according to an SQL statement template, and the database management system executes the SQL statement and returns an execution result to the user. If the SQL statement template in the program is improperly designed, the database resources will be consumed unreasonably when most queries are performed, reducing the performance of the entire system.
As shown in fig. 1, the performance analysis method of the present embodiment includes the following steps:
and step S100, generating a corresponding SQL statement according to the SQL statement template.
In the embodiment of the invention, the SQL statement is automatically generated through the SQL statement template, so that a large amount of SQL statements can be generated to test the SQL statement with the same scale as the actual application scene. Therefore, the performance of the SQL statement template can be evaluated more effectively.
FIG. 2 is a flow chart of a method of generating an SQL statement according to an embodiment of the present invention. As shown in fig. 2, step S100 may include:
step S110, generating a plurality of sets of template parameters of the SQL statement template in a predetermined manner.
For each SQL statement template, there are multiple variables, some of which may be any value or character (e.g., a keyword), and another of which may be an enumerated value (i.e., one of a limited number of possible values). By generating each variable in a random manner, a plurality of sets of template parameters can be obtained, and correspondingly, the generated template parameters can be filled into the SQL statement template to obtain the corresponding SQL statement template. Therefore, various operations of adding, deleting, modifying, searching and the like which can occur in practice can be simulated.
It should be understood that when all variables of the SQL statement template are enumerated values, the sets of template parameters may also be generated in a manner that traverses all possible values.
Step S120, generating a plurality of SQL sentences according to the SQL sentence templates and the template parameters.
In this step, different SQL statements are generated when the template parameters corresponding to the SQL statement template are different. For example, select from table _2where username = ' abcd ', where select from table _2where username = ' is SQL statement template and abcd is template parameter. In step S110, a different character string (e.g., "123") may be randomly generated as a parameter, and a specific SQL statement may be generated in combination with the template.
And step S200, acquiring an execution plan of the SQL statement.
When receiving a database access request initiated by a user, a database management system (MBMS) generates executable code through SQL statements, and operates on stored data in a manner specific to the MBMS, where the specific manner in which the SQL statements are executed by the MBMS may be described by an "execution plan" (also referred to as a query plan). The execution plan is usually in the form of a table in which key fields (i.e., execution plan parameters) in the SQL statement correspond to field values one to one.
In this step, the execution plan of the SQL statement can be obtained by the explain instruction in the MySQL database system. The more common database systems also include Oracle, DB2, SQL Server, etc., and the execution plans obtained by SQL statements in different database systems are different, so that the execution plans of SQL statements can be obtained in different ways according to different databases used.
Fig. 3-5 are exemplary diagrams of execution plans of SQL statements in an embodiment of the invention. As shown in fig. 3-5, is an execution plan for some SQL statements captured in MySQL. The execution plan includes a plurality of execution plan parameters, such as the number (id) of the SQL statement, the type (SQL _ type) of the SQL statement, the name (table) of the table used by the SQL statement query, the partition (partitions) of the table used by the SQL statement query, the type (type) of the connection used by the SQL statement query, the index (permissible _ keys) available for the SQL statement to query, the index (key) selected for the SQL statement to query, the byte length (key _ len) of the index selected for the SQL statement to query, the reference type (ref) of the SQL statement, the number of rows (rows) of which the SQL statement affects the database, and additional information (extra) of the SQL statement. It should be understood that the execution plan parameters of the SQL statement are not limited to the above parameters, and include the execution duration of the SQL statement, the number of bytes returned by the SQL statement in the database, and the like.
The SQL statement mainly includes a selection type (select), an update type (update), and a delete type (delete), and the select _ type is a type of the statement of the selection type in the SQL statement. In the embodiment of the invention, the type of the SQL statement is the type of the statement of the selected type in the SQL statement. Through various existing technologies, when the type of the SQL statement is a non-selection type, the non-selection type SQL statement is converted into the selection type statement. And after converting into the statement of the selected type, acquiring an execution plan of the SQL statement.
Specifically, as shown in fig. 3, the schematic diagram of the execution plan of the SQL statement select × free _2where username = 'abcd'. The execution plan comprises the execution plan parameters of id, select _ type, table, type, posable _ keys, key _ len, ref, rows and extra, wherein id =1, select _ type = single, table = table _2, type = ref, posable _ keys = username, key u len =98, ref = const, rows =1, extra = using where.
As shown in fig. 4, it is a schematic diagram of an execution plan of SQL statement selectid, user from table _2 wherepol3 _intknot group 1000. The execution plan comprises the execution plan parameters of id, select _ type, table, type, pos _ key, key _ len, ref, rows and extra, wherein id =1, select _ u type = simple, table = table 2, type = range, pos u key = idx2, idx3, key = idx3, key _len =4, ref = null, rows =998, and extra = using where; using index.
As shown in fig. 5, is a schematic diagram of an execution plan of the SQL statement select from table _2where col2= 'abcd'. The execution plan comprises the execution plan parameters of id, select _ type, table, type, slot _ keys, key _ len, ref, rows and extra, wherein id =1, select _ type = single, table = table 2, type = all, slot _ keys = null, key _ len =null, ref =null, rows =998, and extra = using whhere.
It should be understood that, when the types of the SQL statement and the corresponding SQL statement template are non-selection type, the non-selection type SQL statement template may be converted into a selection type SQL statement template before step S100, so that the generated SQL statements are all selection type SQL statements. Similarly, the non-selected type of SQL statement may be converted into the selected type of SQL statement in step S200.
Specifically, step S200 may obtain an execution plan of each SQL statement, or obtain an execution plan of a part of the SQL statements, respectively.
The performance of the SQL statement template corresponding to each SQL statement can be evaluated more comprehensively by acquiring the execution plan of each SQL statement, so that the performance of the SQL statement template is optimized more comprehensively. Optionally, a part of the whole SQL statements may be selected for evaluation.
Step S300, acquiring the performance evaluation result of the SQL statement according to the parameters of part or all of the execution plan.
Different execution plan parameters have different influences on the performance of the SQL statement, where the execution plan parameters id, select _ type, table, type, permissible _ keys, key, rows, and extra have a larger influence on the performance of the SQL statement, so in this embodiment, the performance evaluation result of the SQL statement is obtained according to the execution plan parameters. It should be understood that, a person skilled in the art may select some of the parameters of the execution plan according to actual needs, and may also select other parameters of the execution plan and obtain corresponding performance evaluation results.
After obtaining the parameters of part or all of the execution plan, the performance evaluation result of the SQL statement may be obtained in different manners. In an optional implementation manner, the performance evaluation result of the SQL statement may be obtained according to part or all of the execution plan parameters of the execution plan and corresponding predetermined scoring criteria.
In this step, the obtained part or all of the execution plan parameters have corresponding scoring criteria, and the performance evaluation result of the corresponding SQL statement can be accurately obtained according to each execution plan and the corresponding scoring criteria, where the scoring criteria are specific numerical values (that is, it is specified that the execution plan parameters with better performance evaluation result are scored positively or not scored, and the execution plan parameters with worse performance evaluation result are scored negatively). The cost for obtaining the performance evaluation result of the SQL statement according to the preset scoring standard is low, and the scoring standard can be continuously adjusted according to actual needs. In an optional implementation manner of the embodiment of the present invention, the execution plan parameters with the better performance evaluation result are not scored, and the execution plan parameters with the worse performance evaluation result are scored by-10.
Fig. 6 is a schematic diagram of the execution plan parameter id and the predetermined scoring criterion in an alternative implementation of the embodiment of the present invention. As shown in fig. 6, the execution plan parameters include the number (id) of the SQL statement, and the predetermined scoring criterion is such that the SQL statement whose number satisfies the first condition has a worse performance evaluation result. Wherein the first condition is that the number is not 1. The number 1 indicates that the SQL statement uses a simple single-layer query. The number null indicates that the SQL statement is a result set and does not need to be queried. In the actual query, the SQL statement including the sub-query, the associated query, and the like has a large data amount and a high complexity, and therefore in an optional implementation manner of the embodiment of the present invention, the performance of the SQL statement including the sub-query, the associated query, and the like is specified to be poor. Therefore, the SQL statement with the number different from 1 has a worse evaluation result.
FIG. 7 is a diagram illustrating an execution plan parameter select _ type and predetermined scoring criteria in an alternative implementation of an embodiment of the invention. As shown in fig. 7, the execution plan parameters include the type of the SQL statement, and the predetermined scoring criterion is such that the SQL statement whose type satisfies the second condition has a worse performance evaluation result. Wherein the second condition is that the type is not "simple" or "primary". "simple" means that the SQL statement includes an associated query, but only the outermost single-layer query is used in the query; it also means that SQL statements do not include associated queries or sub-queries, and a single-layer query is used in querying. "primary" means that the SQL statement includes sub-queries or associated queries, but only the outermost single-layer query is used in querying. Both of the two queries are simpler single-layer queries, which relate to smaller data in the database and lower complexity, so in an optional implementation manner of the embodiment of the present invention, a SQL statement with a specified type of "simple" or "primary" has better performance, and a SQL statement with a specified type of not "simple" or "primary" has poorer performance, such as "unity", "dependenceunity", and "subquery", for example. Therefore, SQL statements of the selected type that are not "simple" or "primary" have worse performance evaluation results.
Fig. 8 is a schematic diagram of a predetermined scoring criterion corresponding to an execution plan parameter table in an alternative implementation manner of the embodiment of the present invention. As shown in fig. 8, the execution plan parameters include a table used by the SQL statement query, and the predetermined scoring criteria make the SQL statement whose table satisfies the third condition have a worse performance evaluation result. Wherein the third condition is that the table is not a simple table. The SQL statement uses the data table in the database during query, and if only a simple table (that is, a table corresponds to a specific simple table name) is used during query, the complexity of the SQL statement query is low, so in an optional implementation manner of the embodiment of the present invention, the SQL statement that specifies the table as a simple table has good performance. If a temporary table (i.e., a table established in the temporary folder and generated according to the number of the SQL statement) is used, for example, unionM, N (joint table), derivedN, etc., where M and N are the numbers of the SQL statement, indicating that the SQL statement still needs to involve the process of generating the temporary table during query, the complexity is high, and therefore, in an optional implementation manner of the embodiment of the present invention, the performance of the SQL statement that specifies that the table is not a simple table is poor. Therefore, SQL statements where the table is not a simple table have worse performance evaluation results.
FIG. 9 is a diagram of an execution plan parameter type and predetermined scoring criteria in an alternative implementation of an embodiment of the invention. As shown in fig. 9, the execution plan parameters include a connection type used by the SQL statement query, and the predetermined scoring criterion is such that the SQL statement whose connection type satisfies the fourth condition has a worse performance evaluation result. Wherein the fourth condition is that the connection type is not any one of "system", "const", "eq _ ref", "range", "index", or "ref _ or _ null". And sorting the connection types from good to bad, wherein system > const > eq _ ref > ref > ref > ref _ or _ null > rang > index. When the SQL statement queries, the connection types all make the SQL statement use an index, and only use one index, that is, the SQL statement only needs to query according to the index when querying, so in an optional implementation manner of the embodiment of the present invention, the SQL statement that specifies the connection type as any one of "system", "const", "eq _ ref", "range", "index", or "ref _ or _ null" has better performance. Alternatively, different scoring criteria may be set according to the performance ranking of the connection types, such as 5 scores for system and const, 4 scores for eq _ ref and ref, etc. Conversely, for example, if the connection type is "all", the SQL statement performs full-table query during query, then performs filtering at the server to return a record meeting the requirement, and the data size related to the full-table query is the largest, so in an optional implementation manner of the embodiment of the present invention, it is specified that the performance of the SQL statement with the connection type of "all" is poor. As another example, a connection type of "fulltext" indicates that the SQL statement uses a full-text index when queried. The full-text index has a large data volume and a high priority, that is, the full-text index is preferentially used when the full-text index and other indexes exist simultaneously, so that in an optional implementation manner of the embodiment of the present invention, the performance of the SQL statement that specifies the connection type as "fulltext" is poor. Therefore, in an alternative implementation manner of the embodiment of the present invention, the SQL statement that specifies that the connection type is not any one of "system", "const", "eq _ ref", "range", "index", or "ref _ or _ null" has poor performance. Therefore, an SQL statement in which the connection type is not any of "system", "const", "eq _ ref", "range", "index", or "ref _ or _ null" has a worse performance evaluation result.
Fig. 10 is a schematic diagram of an execution plan parameter posable _ keys and a predetermined scoring criterion in an alternative implementation manner according to an embodiment of the present invention. As shown in fig. 10, the execution plan parameters include an index available for the SQL statement to query, and the predetermined scoring criterion is such that the SQL statement whose available index satisfies the fifth condition has a worse performance evaluation result. Wherein a fifth condition is that the available index is null. When the index available for the SQL statement is available (i.e., not empty) at the time of query, the SQL statement is represented to be queried through the index. As shown in fig. 5, when the available index does not exist, it indicates that the SQL statement needs to be subjected to full-table query, and the amount of data involved is the largest, so in an optional implementation manner of the embodiment of the present invention, the performance of the SQL statement that specifies that the available index is empty is poor. Therefore, the SQL statements whose available index is empty have worse performance evaluation results.
FIG. 11 is a diagram illustrating an execution plan parameter key and predetermined scoring criteria in an alternative implementation of an embodiment of the invention. As shown in fig. 11, the execution plan parameters include an index that the SQL statement chooses to use when querying, and the predetermined scoring criterion is such that the SQL statement whose index that chooses to use satisfies the sixth condition has a worse performance evaluation result. Wherein the sixth condition is that the index selected for use is null. It should be understood that when an index available to the SQL statement at query time (pop _ keys) exists, the available index may not be used when actually used, that is, when pop _ keys is not empty, keys are not necessarily not empty. As shown in fig. 5, when the index selected by the SQL statement is empty during query, it indicates that the SQL statement needs to be subjected to full-table query, and the amount of data involved is the largest, so in an optional implementation manner of the embodiment of the present invention, the performance of the SQL statement that the index selected for use is empty is defined to be poor. Therefore, the SQL statements whose index used by the selection is empty have worse performance evaluation results.
Fig. 12 is an alternative implementation of the embodiment of the present invention in which the execution plan parameters rows and the predetermined scoring criteria are used. As shown in fig. 12, the execution plan parameters include the number of rows of the SQL statement that affect the database, and the predetermined scoring criterion is such that the SQL statement whose number of rows satisfies the seventh condition has a worse performance evaluation result. Wherein a seventh condition is that the number of rows is above a predetermined threshold. The number of rows that the SQL statement affects the database above the predetermined threshold indicates that the number of rows that the SQL statement relates to the database when querying is high, that is, the result set returned from the database may be large, so in an alternative implementation manner of the embodiment of the present invention, it is specified that the performance of the SQL statement that affects the database above the predetermined threshold is poor. SQL statements with a number of rows above a predetermined threshold therefore have worse performance evaluation results.
Fig. 13 shows an execution plan parameter extra and predetermined scoring criteria in an alternative implementation of an embodiment of the invention. As shown in fig. 13, the execution plan parameters include additional information of the SQL statements, and the predetermined scoring criterion causes the SQL statements whose additional information satisfies the eighth condition to have worse performance evaluation results. Wherein the eighth condition is that the additional information is "usinfileport". The Extra may contain multiple items of information, for example, "distint" indicates that the SQL statement uses a distint keyword during query, and once the required data is queried, the query is stopped and the result is returned. "using index" indicates that the SQL statement does not need to return to the table for query during query, and the queried data can be directly obtained through the index. Wherein, "using filereport" indicates that the SQL statement needs to be externally ordered in addition to being ordered by the index. The additional external sorting consumes the memory of the server and reduces the running speed, so in an optional implementation manner of the embodiment of the present invention, the performance of the SQL statement that specifies the additional information as "using fileport" is poor. Therefore, the SQL statement with the extra information of "using filereport" has a worse performance evaluation result.
In the embodiment of the invention, the performance of the parameters of the partial execution plan selected in the execution plan of the SQL statement influences the performance of the parameters of the subsequent execution plan. Therefore, in an optional implementation manner of the embodiment of the present invention, when the performance evaluation result of the SQL statement (i.e., the sum of the evaluation results of the execution plan parameters) is lower than the predetermined threshold, the corresponding SQL statement template is marked. It is also possible to stop evaluating subsequent execution plan parameters immediately when a certain execution plan parameter has a worse performance evaluation result (i.e., a negative score). As shown in fig. 5, when the performance evaluation result of the execution plan parameter posable _ keys in the execution plan is poor (i.e., negative score), the performance evaluation of the keys, rows, and extra is stopped, so that the evaluation time can be reduced, and the performance of the SQL statement can be evaluated more quickly.
In another optional implementation manner of the embodiment of the present invention, part or all of the parameters of the execution plan of the SQL statement may be input into a classification model to obtain a performance evaluation result of the SQL statement. The classification model is obtained by pre-training according to performance evaluation samples, and the performance evaluation samples comprise SQL statements and corresponding performance evaluation results.
The classification model is to construct a classification function on the basis of the existing performance evaluation samples, and is used for mapping the SQL statement and the corresponding classification (namely, the performance evaluation result) one by one. That is, the SQL statements are input into the classification model, and the classification model outputs the SQL statements into the corresponding classifications according to the constructed classification functions (i.e., obtains the corresponding performance evaluation results).
In this step, when the number of SQL statements to be evaluated is large or no corresponding scoring criteria are preset, the sample SQL statements may be evaluated to obtain a performance evaluation result, and the sample SQL statements may be used as performance evaluation samples to train a classification model. Specifically, the performance evaluation result of the performance evaluation sample may be obtained by obtaining the input score, and may also be obtained by performing log analysis on an SQL statement. Analyzing the execution log of the SQL statement may directly evaluate the performance of the SQL statement and obtain a performance evaluation result of the SQL statement, thereby serving as a performance evaluation sample.
After the classification model is obtained, inputting part or all of the execution plan parameters of the execution plan of the SQL statement to be evaluated into the classification model to obtain the performance evaluation result of the SQL statement. The classification model obtained by training according to the evaluation sample can more accurately classify unknown classified data (namely, the SQL sentence to be evaluated), and the model can be continuously learned and updated. For the present embodiment, the classification model can be established by using various existing modeling manners, such as SVM (Support Vector Machines), linear regression, logistic regression, naive bayes, linear discriminant analysis, decision trees, K-NN (K-nearest neighbor analysis), and the like. Specifically, the classification model divides the SQL statements to be evaluated into two categories (i.e., including two classification results), one category is the SQL statements with better performance evaluation results, and the other category is the SQL statements with worse performance evaluation results.
And step S400, marking the SQL statement template according to the performance evaluation result.
In this step, after the performance evaluation result of each SQL statement is obtained, the SQL statement template corresponding to the SQL statement is marked according to the performance evaluation result. Specifically, the SQL statement template with the better performance evaluation result and the SQL statement template with the worse performance evaluation result may be respectively marked, or only the SQL statement template with the better performance evaluation result or only the SQL statement template with the worse performance evaluation result may be marked. More specifically, in response to a predetermined number or a predetermined proportion of the performance analysis results of the SQL statements satisfying the ninth condition, the corresponding SQL statement templates may be marked as potential low-performance templates. When the execution plan parameters with worse performance evaluation results in a certain SQL statement reach a predetermined number or a predetermined proportion, the performance of the SQL statement may be considered as worse, so that the corresponding SQL statement template is marked as a potential low-performance template.
According to the embodiment of the invention, the performance evaluation result of the database query statement is obtained according to the execution plan of the database query statement generated according to the database query statement template and the parameters of part or all of the execution plan, so that the database query statement template is marked according to the performance evaluation result. Therefore, the performance of the database query statement template can be evaluated more accurately before the database query statement template is on-line.
Fig. 14 is a schematic diagram of a performance evaluation apparatus of an embodiment of the present invention. As shown in fig. 14, the performance evaluation apparatus 14 of the embodiment of the present invention includes a sentence acquisition unit 141, a sentence processing unit 142, a sentence evaluation unit 143, and a marking unit 144.
The statement acquiring unit 141 is configured to generate a corresponding database query statement according to the database query statement template. The statement processing unit 142 is configured to obtain an execution plan of the database query statement. The statement evaluation unit 143 is configured to obtain a performance evaluation result of the database query statement according to a part or all of the execution plan parameters of the execution plan. The marking unit 144 is configured to mark the database query statement template according to the performance evaluation result.
Further, the sentence acquisition unit 141 includes a parameter generation sub-unit 1411 and a sentence generation sub-unit 1412.
Wherein the parameter generating sub-unit 1411 is configured to generate a plurality of sets of template parameters of the database query statement template in a predetermined manner, and the statement generating sub-unit 1412 is configured to generate a plurality of database query statements according to the database query statement template and the template parameters.
Further, the statement processing unit 142 is configured to obtain an execution plan of each database query statement.
Further, the statement evaluation unit 143 is configured to obtain a performance evaluation result of the database query statement according to a part or all of the execution plan parameters of the execution plan and a corresponding predetermined scoring criterion.
Further, the execution plan parameters include the number of the database query statement, and the statement evaluation unit 143 is configured to make the SQL statement whose number meets the first condition have a worse performance evaluation result according to the predetermined scoring criterion.
Further, the execution plan parameters include a type of the database query statement, and the statement evaluation unit 143 is configured to make a database query statement of which the type satisfies the second condition have a worse performance evaluation result according to the predetermined scoring criterion.
Further, the execution plan parameters include names of tables used by the database query statement query, and the statement evaluation unit 143 is configured to make database query statements whose tables satisfy a third condition have worse performance evaluation results according to the predetermined scoring criteria.
Further, the execution plan parameters include a connection type used by the database query statement query, and the statement evaluation unit 143 is configured to make a database query statement with the connection type satisfying a fourth condition have a worse performance evaluation result according to the predetermined scoring criterion.
Further, the execution plan parameters include an available index of the database query statement at the time of query, and the statement evaluation unit 143 is configured to make the available index satisfy the database query statement with a worse performance evaluation result according to the predetermined scoring criterion.
Further, the partial or all execution plan parameters include an index selected by the database query statement for use in querying, and the statement evaluation unit 143 is configured to make the database query statement whose index selected for use satisfies a sixth condition have a worse performance evaluation result according to the predetermined scoring criterion.
Further, the execution plan parameters include the number of rows that the database query statement affects the database, and the statement evaluation unit 143 is configured to make the database query statement with the number of rows satisfying the seventh condition have a worse performance evaluation result according to the predetermined scoring criterion.
Further, the execution plan parameters include additional information of the database query statement, and the statement evaluation unit 143 is configured to make a database query statement, whose additional information satisfies an eighth condition, have a worse performance evaluation result according to the predetermined scoring criterion.
Further, the apparatus further comprises a sentence conversion unit 145.
The statement converting unit 145 is configured to, when the type of the database query statement is a non-selection type, convert the database query statement of the non-selection type into the statement of the selection type.
Further, the statement evaluation unit 143 is configured to input a part of or all of the execution plan parameters of the execution plan of the database query statement into a classification model to obtain a performance evaluation result of the database query statement, where the classification model is obtained by pre-training a performance evaluation sample, and the performance evaluation sample includes the database query statement and a corresponding performance evaluation result.
Further, the performance evaluation result of the performance evaluation sample is obtained through manual scoring, or the performance evaluation result of the database query performance evaluation sample is obtained through log analysis performed on a database query statement.
Further, the marking unit 144 is configured to mark the corresponding database query statement template when the result of the performance analysis of the database query statement satisfies the ninth condition.
FIG. 15 is a schematic view of an electronic device of an embodiment of the invention. The electronic device shown in fig. 15 is a general-purpose data processing apparatus comprising a general-purpose computer hardware structure including at least a processor 151 and a memory 152. The processor 151 and the memory 152 are connected by a bus 153. The memory 152 is adapted to store instructions or programs executable by the processor 151. Processor 151 may be a stand-alone microprocessor or a collection of one or more microprocessors. Thus, processor 151 implements the processing of data and the control of other devices by executing commands stored in memory 152 to thereby execute the method flows of embodiments of the present invention as described above. The bus 153 connects the above components together, and also connects the above components to a display controller 154 and a display device and an input/output (I/O) device 155. Input/output (I/O) device 155 may be a mouse, keyboard, modem, network interface, touch input device, motion sensing input device, printer, and other devices known in the art. Typically, an input/output (I/O) device 155 is coupled to the system through an input/output (I/O) controller 156.
Memory 152 may store, among other things, software components such as an operating system, communication modules, interaction modules, and application programs. Each of the modules and applications described above corresponds to a set of executable program instructions that perform one or more functions and methods described in embodiments of the invention.
The foregoing flowchart and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention illustrate various aspects of the present disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Also, as will be appreciated by one skilled in the art, aspects of the present embodiments may be embodied as a system, method or computer program product. Accordingly, various aspects of embodiments of the invention may take the form of: an entirely hardware implementation, an entirely software implementation (including firmware, resident software, micro-code, etc.) or an implementation combining software and hardware aspects that may all generally be referred to herein as a "circuit," module "or" system. Further, aspects of the present disclosure may take the form of: a computer program product embodied in one or more computer readable media having computer readable program code embodied thereon.
Any combination of one or more computer-readable media may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of embodiments of the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to: electromagnetic, optical, or any suitable combination thereof. The computer readable signal medium may be any of the following computer readable media: is not a computer readable storage medium and may communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including: object-oriented programming languages such as Java, smalltalk, C + +, PHP, python, and the like; and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package; executing in part on a user computer and in part on a remote computer; or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
FIG. 16 is a schematic interface diagram of a performance assessment application of an embodiment of the present invention. As shown in fig. 16, the performance evaluation application of the present embodiment may input a database query statement template to be evaluated in the database query statement template input window 161. Specifically, the input database query statement template is select from table _ 2wherecol2 = ", the performance evaluation application generates a corresponding database query statement and performs performance evaluation on the generated database query statement, and the generated database query statement and a corresponding performance evaluation result are displayed in the database query statement performance evaluation display window 162. Specifically, the generated database query statement includes select from table _2where col2= 'abcd', and the corresponding performance evaluation result is poor. When a predetermined number or a predetermined proportion of database query statements satisfy the ninth condition (e.g., more than half of the total number of generated database queries), the corresponding database query statement template is marked as a potential low performance template and displayed in the database query statement template performance evaluation presentation window 163. Specifically, the content displayed in the performance evaluation display window 163 of the database query statement template may be "the database query statement template is a potential low-performance template, and optimization is suggested".
The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure, and various modifications and changes may be made to the present disclosure by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included within the scope of the present disclosure.

Claims (26)

1. A method of performance analysis, the method comprising:
generating a corresponding database query statement according to the database query statement template;
acquiring an execution plan of the database query statement;
acquiring a performance evaluation result of the database query statement according to part or all of the execution plan parameters of the execution plan; and
marking the database query statement template according to the performance evaluation result;
wherein the obtaining of the performance evaluation result of the database query statement according to the parameters of the partial or all execution plans of the execution plan comprises:
inputting part or all of the parameters of the execution plan of the database query statement into a classification model to obtain a performance evaluation result of the database query statement, wherein the classification model is obtained by pre-training a performance evaluation sample, and the performance evaluation sample comprises part of the database query statement and a corresponding performance evaluation result;
the performance evaluation result of the performance evaluation sample is obtained by acquiring the input score or by performing log analysis on a database query statement;
the score is obtained according to partial or all execution plan parameters of the execution plan and a preset score standard;
wherein marking the database query statement template according to the performance evaluation result comprises:
and in response to the performance analysis results of the database query statement of a preset number or a preset proportion meet a ninth condition, marking the corresponding database query statement template as a potential low-performance template.
2. The performance analysis method of claim 1, wherein generating the corresponding database query statement according to the database query statement template comprises:
generating a plurality of groups of template parameters of the database query statement template in a preset mode; and
and generating a plurality of database query sentences according to the database query sentence template and the template parameters.
3. The performance analysis method of claim 1, wherein obtaining the execution plan for the database query statement comprises:
respectively acquiring an execution plan of each database query statement; or
And acquiring an execution plan of part of the database query statement.
4. The performance analysis method of claim 1, wherein the execution plan parameters comprise a number of the database query statement;
the predetermined scoring criteria causes the database query statement whose number satisfies the first condition to have a worse performance evaluation result.
5. The performance analysis method of claim 1, wherein the execution plan parameters include a type of the database query statement;
the predetermined scoring criteria causes database query statements of the type satisfying the second condition to have poorer performance evaluation results.
6. The performance analysis method of claim 1, wherein the execution plan parameters include tables used by the database query statement query;
the predetermined scoring criteria causes database query statements whose tables satisfy a third condition to have worse performance evaluation results.
7. The performance analysis method of claim 1, wherein the execution plan parameters include a connection type used by the database query statement query;
the predetermined scoring criteria causes database query statements whose connection type satisfies a fourth condition to have worse performance evaluation results.
8. The performance analysis method of claim 1, wherein the execution plan parameters include an index that the database query statement is available at query time;
the predetermined scoring criteria causes the database query statements for which the available index satisfies the fifth condition to have worse performance evaluation results.
9. The performance analysis method of claim 1, wherein the execution plan parameters include an index that the database query statement chooses to use when querying;
the predetermined scoring criteria causes the database query statement whose index used by the selection satisfies the sixth condition to have a worse performance evaluation result.
10. The performance analysis method of claim 1, wherein the execution plan parameters include a number of rows that the database query statement affects a database;
the predetermined scoring criteria causes database query statements having the row number satisfying a seventh condition to have poorer performance evaluation results.
11. The performance analysis method of claim 1, wherein the execution plan parameters include additional information for the database query statement;
the predetermined scoring criterion is such that database query statements whose additional information satisfies the eighth condition have worse performance evaluation results.
12. The performance analysis method of claim 1, further comprising:
and when the type of the database query statement is a non-selection type, converting the non-selection type database query statement into a selection type statement.
13. A performance analysis apparatus, the apparatus comprising:
the sentence acquisition unit is used for generating a corresponding database query sentence according to the database query sentence template;
a statement processing unit, configured to obtain an execution plan of the database query statement;
the statement evaluation unit is used for acquiring a performance evaluation result of the database query statement according to part or all of the execution plan parameters of the execution plan;
the marking unit is used for marking the database query statement template according to the performance evaluation result;
the statement evaluation unit is used for inputting part or all of execution plan parameters of an execution plan of the database query statement into a classification model to obtain a performance evaluation result of the database query statement, the classification model is obtained by pre-training according to a performance evaluation sample, and the performance evaluation sample comprises part of the database query statement and a corresponding performance evaluation result;
wherein the performance evaluation result of the performance evaluation sample is obtained by acquiring an input score or by performing log analysis on a database query statement;
the score is obtained according to partial or all execution plan parameters of the execution plan and a preset score standard;
the marking unit is used for marking the corresponding database query statement template as a potential low-performance template in response to that the performance analysis result of the database query statement of a preset number or a preset proportion meets a ninth condition.
14. The performance analysis apparatus according to claim 13, wherein the sentence acquisition unit includes:
the parameter generating subunit is used for generating a plurality of groups of template parameters of the database query statement template in a preset mode; and
and the statement generating subunit is used for generating a plurality of database query statements according to the database query statement template and the template parameters.
15. The apparatus according to claim 13, wherein the statement processing unit is configured to obtain an execution plan of each of the database query statements, or an execution plan of a part of the database query statements, respectively.
16. The performance analysis apparatus of claim 13, wherein the execution plan parameters comprise a number of the database query statement;
the statement evaluation unit is used for enabling the database query statement with the number meeting the first condition to have a worse performance evaluation result according to the predetermined scoring standard.
17. The performance analysis apparatus of claim 13, wherein the execution plan parameters comprise a type of the database query statement;
the statement evaluation unit is used for enabling the database query statement of which the type meets the second condition to have worse performance evaluation results according to the preset scoring standard.
18. The performance analysis apparatus of claim 13, wherein the execution plan parameters comprise a table used by the database query statement query;
the statement evaluation unit is used for enabling the database query statement of which the table meets the third condition to have worse performance evaluation results according to the preset scoring standard.
19. The performance analysis apparatus of claim 13, wherein the execution plan parameters comprise a connection type used by the database query statement query;
the statement evaluation unit is used for enabling the database query statement of which the connection type meets the fourth condition to have a worse performance evaluation result according to the preset scoring standard.
20. The performance analysis apparatus of claim 13, wherein the execution plan parameters comprise an index that the database query statement is available at query time;
the statement evaluation unit is configured to make the database query statement with the available index satisfying a fifth condition have a worse performance evaluation result according to the predetermined scoring criterion.
21. The performance analysis device of claim 13, wherein the execution plan parameters comprise an index that the database query statement chooses to use when querying;
the statement evaluation unit is used for enabling the selected database query statement with the index meeting the sixth condition to have worse performance evaluation results according to the preset scoring standard.
22. The performance analysis device of claim 13, wherein the execution plan parameters comprise a number of rows that the database query statement affects a database;
the statement evaluation unit is configured to make the database query statement with the row number satisfying a seventh condition have a worse performance evaluation result according to the predetermined scoring criterion.
23. The performance analysis device of claim 13, wherein the execution plan parameters comprise additional information of the database query statement;
the statement evaluation unit is configured to make the database query statement with the additional information satisfying the eighth condition have a worse performance evaluation result according to the predetermined scoring criterion.
24. The performance analysis apparatus of claim 13, further comprising:
and the statement conversion unit is used for converting the database query statement of the non-selection type into a statement of the selection type when the type of the database query statement is the non-selection type.
25. A computer-readable storage medium on which computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-12.
26. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-12.
CN201810988624.7A 2018-08-28 2018-08-28 Performance analysis method, performance analysis device, storage medium, and electronic apparatus Active CN109240901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810988624.7A CN109240901B (en) 2018-08-28 2018-08-28 Performance analysis method, performance analysis device, storage medium, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810988624.7A CN109240901B (en) 2018-08-28 2018-08-28 Performance analysis method, performance analysis device, storage medium, and electronic apparatus

Publications (2)

Publication Number Publication Date
CN109240901A CN109240901A (en) 2019-01-18
CN109240901B true CN109240901B (en) 2023-01-17

Family

ID=65068587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810988624.7A Active CN109240901B (en) 2018-08-28 2018-08-28 Performance analysis method, performance analysis device, storage medium, and electronic apparatus

Country Status (1)

Country Link
CN (1) CN109240901B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618933B (en) * 2019-08-15 2021-05-11 华为技术有限公司 Performance analysis method and system, electronic device and storage medium
CN110895542B (en) * 2019-11-28 2022-09-27 中国银行股份有限公司 High-risk SQL statement screening method and device
CN111046059B (en) * 2019-12-09 2023-06-30 中国建设银行股份有限公司 Low-efficiency SQL statement analysis method and system based on distributed database cluster
CN111353049A (en) * 2020-02-24 2020-06-30 京东方科技集团股份有限公司 Data updating method and device, electronic equipment and computer readable storage medium
CN113326246A (en) 2020-02-28 2021-08-31 华为技术有限公司 Method, device and system for estimating performance of database management system
CN111414351A (en) * 2020-03-20 2020-07-14 中国建设银行股份有限公司 Performance diagnosis method and device of MySQ L database
CN111858280B (en) * 2020-07-16 2024-02-27 中国工商银行股份有限公司 SQL information processing method, device, equipment and system
CN111913937B (en) * 2020-07-31 2024-03-08 中国工商银行股份有限公司 Database operation and maintenance method and device
CN112685444A (en) * 2020-12-24 2021-04-20 江苏苏宁云计算有限公司 Data query method and device, computer equipment and storage medium
CN113190422B (en) * 2021-03-22 2022-05-13 云和恩墨(北京)信息技术有限公司 Quality analysis method, device, terminal and medium for SQL (structured query language) statements

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016091356A (en) * 2014-11-06 2016-05-23 Kddi株式会社 Virtual database system management device, management method and management program
CN107798017A (en) * 2016-09-07 2018-03-13 南京中兴新软件有限责任公司 Executive plan information generating method and system in distributed data base

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6092062A (en) * 1997-06-30 2000-07-18 International Business Machines Corporation Relational database query optimization to perform query evaluation plan, pruning based on the partition properties
US8090735B2 (en) * 2007-06-22 2012-01-03 International Business Machines Corporation Statement generation using statement patterns
US8341178B2 (en) * 2007-09-18 2012-12-25 Oracle International Corporation SQL performance analyzer
US8805852B2 (en) * 2009-03-02 2014-08-12 International Business Machines Corporation Automatic query execution plan management and performance stabilization for workloads
EP2648105B8 (en) * 2012-04-04 2019-06-05 Accenture Global Services Limited Database performance analysis
AU2015201361B2 (en) * 2014-11-14 2017-03-02 Tata Consultancy Services Limited A method and system for efficient performance prediction of structured query for big data
US20160259825A1 (en) * 2015-03-06 2016-09-08 Dell Products L.P. Discovery of potential problematic execution plans in a bind-sensitive query statement
CN105224690B (en) * 2015-10-30 2019-06-18 上海达梦数据库有限公司 Generate and select the method and system of the executive plan of the corresponding sentence containing ginseng
CN106445795B (en) * 2016-09-26 2019-03-22 中国工商银行股份有限公司 A kind of database SQL Efficiency testing method and device
CN107273465A (en) * 2017-06-05 2017-10-20 环球智达科技(北京)有限公司 SQL injection detection method
CN108197306B (en) * 2018-01-30 2020-08-25 平安科技(深圳)有限公司 SQL statement processing method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016091356A (en) * 2014-11-06 2016-05-23 Kddi株式会社 Virtual database system management device, management method and management program
CN107798017A (en) * 2016-09-07 2018-03-13 南京中兴新软件有限责任公司 Executive plan information generating method and system in distributed data base

Also Published As

Publication number Publication date
CN109240901A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN109240901B (en) Performance analysis method, performance analysis device, storage medium, and electronic apparatus
US10769552B2 (en) Justifying passage machine learning for question and answer systems
CN111353310B (en) Named entity identification method and device based on artificial intelligence and electronic equipment
US9621601B2 (en) User collaboration for answer generation in question and answer system
US9799040B2 (en) Method and apparatus for computer assisted innovation
US20140108313A1 (en) Ranking in cascading learning system
US9342592B2 (en) Method for systematic mass normalization of titles
CN104636478A (en) Information query method and device
JP2020500371A (en) Apparatus and method for semantic search
JP2016532173A (en) Semantic information, keyword expansion and related keyword search method and system
CN109299245B (en) Method and device for recalling knowledge points
KR20050073429A (en) Machine-learned approach to determining document relevance for search over large electronic collections of documents
JP2018067278A (en) Device, method, and program for recognizing data property
US9043321B2 (en) Enhancing cluster analysis using document metadata
CN109471889A (en) Report accelerated method, system, computer equipment and storage medium
US20230040412A1 (en) Multi-language source code search engine
CN109344400A (en) A kind of judgment method and device of document storage
CN113297251A (en) Multi-source data retrieval method, device, equipment and storage medium
KR20160120583A (en) Knowledge Management System and method for data management based on knowledge structure
JP2023147236A (en) Machine learning pipeline augmented with explanation
CN109325099A (en) A kind of method and apparatus of automatically retrieval
CN111368055A (en) Retrieval method and device for patent database combined enterprise information platform
CN112527982A (en) Equipment management system, method, equipment and storage medium
CN116501841B (en) Fuzzy query method, system and storage medium for data model
CN112100370B (en) Picture-trial expert combination recommendation method based on text volume and similarity algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 202, 2 floors, 1-3 floors, No. 11 Shangdi Information Road, Haidian District, Beijing 100085

Applicant after: Beijing Xingxuan Technology Co.,Ltd.

Address before: Room 202, 2 floors, 1-3 floors, No. 11 Shangdi Information Road, Haidian District, Beijing 100085

Applicant before: Beijing Xiaodu Information Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant