CN113590647B - SQL sentence optimization method, device, equipment, storage medium and product - Google Patents

SQL sentence optimization method, device, equipment, storage medium and product Download PDF

Info

Publication number
CN113590647B
CN113590647B CN202110865659.3A CN202110865659A CN113590647B CN 113590647 B CN113590647 B CN 113590647B CN 202110865659 A CN202110865659 A CN 202110865659A CN 113590647 B CN113590647 B CN 113590647B
Authority
CN
China
Prior art keywords
audit
sql
sql statement
auditing
result
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
CN202110865659.3A
Other languages
Chinese (zh)
Other versions
CN113590647A (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202110865659.3A priority Critical patent/CN113590647B/en
Publication of CN113590647A publication Critical patent/CN113590647A/en
Application granted granted Critical
Publication of CN113590647B publication Critical patent/CN113590647B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2448Query languages for particular applications; for extensibility, e.g. user defined types
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an SQL sentence optimization method, device, equipment, storage medium and product. The method comprises the following steps: receiving an SQL statement audit request, and acquiring an SQL statement to be audited according to the SQL statement audit request; auditing the SQL statement to be audited by adopting a preset SQL audit policy to obtain a corresponding audit result; determining whether to optimize the SQL statement according to the auditing result; if yes, optimizing the SQL sentence according to the audit deduction item corresponding to the audit result. According to the method, whether the SQL statement has a problem or not can be determined according to the auditing result, so that the SQL statement with the problem is automatically optimized according to the auditing deduction item, the optimization efficiency is improved, and the optimization time is shortened.

Description

SQL sentence optimization method, device, equipment, storage medium and product
Technical Field
The present invention relates to the field of SQL database technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a product for optimizing an SQL statement.
Background
The structured query language (Structured Query Language), abbreviated as SQL, is a special purpose programming language, a database query and programming language, for accessing data and querying, updating and managing relational database systems.
In the work of the database, the SQL statement executed by the database is frequently required to be audited, the SQL statement audit of the database is an important ring in the software development process, and the overall performance of the data can be improved through audit. The conventional SQL statement auditing mode is usually manual auditing or system automatic auditing, and when the manual auditing or system automatic auditing finds that the SQL statement has problems, a developer is informed that the SQL statement is wrong, and the developer needs to correct and optimize the SQL.
The existing SQL statement correction optimization mode requires manual optimization by a developer, the manual optimization is low in efficiency and time-consuming, and the developer does not know which part of the SQL statement has a problem.
Disclosure of Invention
The invention provides an SQL sentence optimization method, device, equipment, storage medium and product, which are used for solving the problem that the existing SQL sentence is manually optimized when the existing SQL sentence is optimized.
In a first aspect, the present invention provides an SQL statement optimization method, including:
receiving a Structured Query Language (SQL) statement audit request, and acquiring an SQL statement to be audited according to the SQL statement audit request;
auditing the SQL statement to be audited by adopting a preset SQL audit policy to obtain a corresponding audit result;
Determining whether to optimize the SQL statement according to the auditing result;
if yes, optimizing the SQL sentence according to the audit deduction item corresponding to the audit result.
In a second aspect, the present invention provides an SQL statement optimization apparatus, comprising:
the request receiving unit is used for receiving an SQL statement auditing request and acquiring an SQL statement to be audited according to the SQL statement auditing request;
the auditing unit is used for auditing the SQL statement to be audited by adopting a preset SQL auditing strategy to obtain a corresponding auditing result;
the determining unit is used for determining whether the SQL sentence is optimized or not according to the auditing result;
and the optimizing unit is used for optimizing the SQL sentence according to the audit deduction item corresponding to the audit result if the SQL sentence is the same as the SQL sentence.
In a third aspect, the present invention provides an electronic device comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory, causing the at least one processor to perform the method as described in the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored therein computer-executable instructions for performing the method according to the first aspect when executed by a processor.
In a fifth aspect, the invention provides a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect.
According to the SQL statement optimization method, the device, the equipment, the storage medium and the product, the SQL statement to be audited is further obtained according to the SQL statement audit request by receiving the SQL statement audit request, so that the SQL statement to be audited is audited by adopting a preset SQL audit strategy to obtain a corresponding audit result; determining whether to optimize the SQL statement according to the auditing result; if yes, optimizing the SQL sentence according to the audit deduction item corresponding to the audit result. According to the method and the device, whether the SQL statement has the problem or not can be determined according to the auditing result, so that the SQL statement with the problem is automatically optimized according to the auditing deduction item, the optimization efficiency is improved, and the optimization time is shortened.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram of a network architecture of an SQL statement optimization method provided by the invention;
FIG. 2 is a flowchart of an SQL statement optimization method according to an embodiment of the invention;
FIG. 3 is a flow chart of a SQL statement optimization method according to a third embodiment of the invention;
FIG. 4 is a flowchart of a SQL statement optimization method according to a fourth embodiment of the invention;
FIG. 5 is a flowchart of an SQL statement optimization method according to a fifth embodiment of the invention;
FIG. 6 is a flowchart of a SQL statement optimization method according to a sixth embodiment of the invention;
FIG. 7 is a flowchart of a SQL statement optimization method according to a seventh embodiment of the invention;
FIG. 8 is a flowchart of an SQL statement optimization method according to an eighth embodiment of the invention;
FIG. 9 is a flowchart of a SQL statement optimization method according to a ninth embodiment of the invention;
FIG. 10 is a schematic diagram of an SQL statement optimizing device according to an embodiment of the invention;
FIG. 11 is a first block diagram of an electronic device for implementing an SQL statement optimization method of an embodiment of the invention;
FIG. 12 is a second block diagram of an electronic device for implementing the SQL statement optimization method of the invention.
Specific embodiments of the present disclosure have been shown by way of the above drawings and will be described in more detail below. These drawings and the written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
For a clear understanding of the technical solutions of the present application, the prior art solutions will be described in detail first.
In the prior art, in order to avoid risks brought to database performance by tasks such as database updating and query and the like, whether the SQL work orders submitted by research and development personnel are reasonable and effective needs to be checked and evaluated, and operations (adding, deleting, changing, checking, creating, batched and the like) corresponding to the SQL work orders can be installed and executed on corresponding data after the evaluation is passed. When the existing audit is usually manual audit or the system automatically audits aiming at the SQL statement, and the problem of the SQL statement is found, a developer is informed that the SQL statement is wrong, and the developer needs to correct and optimize the SQL.
In the prior art, the research and development personnel know that the SQL sentence is wrong, and need to search the wrong part of the SQL sentence and revise the SQL sentence again, but the research and development personnel have different level differences, and possibly do not know where the SQL sentence is wrong, or need to take some time to find out the problem, so that the SQL sentence can be revised and optimized. The existing SQL statement optimizing mode is based on manual operation, manual operation optimizing is low in efficiency and time-consuming, and a developer does not know which part of the SQL statement has a problem.
Therefore, aiming at the problem that a developer is required to manually optimize in the SQL statement correction optimization mode in the prior art, the inventor finds out in the research that the SQL statement to be audited is further obtained according to the SQL statement audit request by receiving the SQL statement audit request, so that the SQL statement to be audited is audited by adopting a preset SQL audit strategy to obtain a corresponding audit result; determining whether to optimize the SQL statement according to the auditing result; if yes, optimizing the SQL sentence according to the audit deduction item corresponding to the audit result. According to the auditing result, whether the SQL statement has a problem or not can be determined, so that the SQL statement with the problem is automatically optimized according to the auditing deduction item, the optimization efficiency is improved, and the optimization time is shortened.
The inventor proposes the technical scheme of the embodiment of the invention based on the creative discovery. The network architecture and application scenario of the SQL statement optimization method provided by the embodiment of the invention are described below.
As shown in fig. 1, the network architecture corresponding to the SQL statement optimization method provided by the embodiment of the invention includes: the electronic device 1 and the server 2. The electronic device 1 is in communication with the server 2. The electronic device 1 is pre-provided with a client corresponding to the SQL sentence optimization method. The method comprises the steps that a user inputs an SQL sentence to be audited in an input box of an operation interface of a client, a confirmation button is clicked, so that an SQL sentence audit request is triggered, the electronic equipment 1 analyzes the SQL sentence audit request to obtain an SQL sentence to be audited corresponding to the audit request, the electronic equipment 1 obtains a preset SQL audit strategy sent by a server 2, and the electronic equipment 1 audits the SQL sentence to be audited by adopting the preset SQL audit strategy to obtain a corresponding audit result; determining whether to optimize the SQL statement according to the auditing result; if yes, optimizing the SQL sentence according to the audit deduction item corresponding to the audit result. According to the auditing result, whether the SQL statement has a problem or not can be determined, so that the SQL statement with the problem is automatically optimized according to the auditing deduction item, the optimization efficiency is improved, and the optimization time is shortened.
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Example 1
Fig. 2 is a flow chart of an SQL statement optimization method according to an embodiment of the present invention, as shown in fig. 2, an execution body of the SQL statement optimization method according to the embodiment is an SQL statement optimization device, and the SQL statement optimization device is located in an electronic device, and the SQL statement optimization method according to the embodiment includes the following steps:
and step 101, receiving an SQL statement audit request of the structured query language, and acquiring the SQL statement to be audited according to the SQL statement audit request.
In this embodiment, the SQL statement optimization device includes a WEB front end, and a user may input an SQL statement to be audited and a database corresponding to the SQL statement through an SQL entry page corresponding to the WEB front end, so as to trigger an SQL statement audit request, and the SQL statement optimization device receives the SQL statement audit request and analyzes the SQL statement audit request to obtain the SQL statement to be audited and the database corresponding to the SQL statement.
The method comprises the steps that an SQL statement to be audited consists of an SQL work order to be audited, one or more SQL work orders can be added by a user, or a plurality of SQL work orders are imported in batches, and the SQL statement to be audited is generated by at least one SQL work order.
The database corresponding to the SQL statement refers to a database for executing the SQL statement, and the database comprises a plurality of databases, such as an SQL database, an Ali-RDS database and an aliDRDS database, and the database for executing the SQL statement is designated by a user.
And 102, auditing the SQL statement to be audited by adopting a preset SQL audit policy to obtain a corresponding audit result.
In this embodiment, a user, for example, a database administrator, sets an SQL audit policy according to production needs and technical experience from performance issues concerned in an SQL audit work, where the SQL audit policy includes a syntax audit policy and an execution plan audit policy, each audit policy includes at least one audit item, each audit item corresponds to an audit score, and an SQL statement optimizing device generates a preset SQL audit policy according to the SQL audit policy input by the user, and performs audit on SQL statements to be audited by adopting the preset syntax audit policy and/or the execution plan audit policy, so as to obtain an audit result.
And step 103, determining whether to optimize the SQL statement according to the auditing result.
In this embodiment, whether the SQL statement has a problem is determined according to the obtained auditing result, if the SQL statement does not have a problem, the SQL statement does not need to be optimized, the user is further informed that the SQL statement does not have a problem, and prompt information that the SQL statement is audited to pass can be sent to the user terminal. If the SQL statement has problems, the SQL statement needs to be optimized, and prompt information that the SQL statement audit fails can be sent to the user terminal.
And step 104, if yes, optimizing the SQL sentence according to the audit deduction item corresponding to the audit result.
In this embodiment, the audit result includes audit deduction items and/or audit score items, audit scores corresponding to the audit deduction items, and audit scores corresponding to the audit score items, where the audit score items indicate that the corresponding audit items have no problems, and do not need to be optimized, and the audit deduction items indicate that the corresponding audit items have problems, and further optimization is needed, and the SQL statement optimization device may optimize the SQL statement according to the audit deduction items.
In the embodiment, whether the SQL statement has a problem or not can be determined according to the auditing result, so that the SQL statement with the problem is automatically optimized according to the auditing deduction item, the optimization efficiency is improved, and the optimization time is shortened.
Example two
On the basis of the SQL sentence optimization method provided by the first embodiment of the invention, step 103 is further refined, which comprises the following steps:
step 1031, obtaining an audit score corresponding to the audit result, and determining whether the audit score is equal to a preset score; if yes, go to step 1032; if not, go to step 1033.
In this embodiment, an audit score corresponding to an audit result is obtained, where the corresponding audit score is an audit total score, and the audit scores corresponding to a plurality of audit score items are added to obtain the audit total score. And comparing the audit score corresponding to the audit result with a preset score to determine whether the audit score corresponding to the audit result is equal to the preset score, wherein the preset score is a preset total score.
In step 1032, it is determined that no optimization of the SQL statement is required.
In this embodiment, if the audit score corresponding to the audit result is equal to the preset score, it is indicated that the SQL statement is fully divided, and if the audit result passes, the SQL statement needs to be optimized.
Step 1033, determining to optimize the SQL statement.
In this embodiment, if the audit score corresponding to the audit result is equal to the preset score, it is indicated that the SQL statement is not fully scored, and if the deduction item exists through the non-audit, the SQL statement needs to be optimized.
Example III
Fig. 3 is a flow chart of an SQL statement optimization method provided in the third embodiment of the present invention, as shown in fig. 3, based on the SQL statement optimization method provided in the first embodiment of the present invention, step 104 is further refined, and the method includes the following steps:
step 1041, determining a matched optimization strategy according to the audit deduction item.
In this embodiment, an audit deduction item is determined according to an audit result, a mapping relationship between the audit deduction item and an optimization policy is established in advance according to the audit deduction item, the optimization policies corresponding to different items are different, the optimization policy includes SQL statement modification information, and a matched optimization policy is determined according to the mapping relationship.
Step 1042, optimizing the SQL sentence by adopting the matched optimization strategy to obtain the optimized SQL sentence.
In this embodiment, the SQL statement optimization device reads the SQL statement modification information in the matched optimization policy, and generates an SQL statement optimization instruction according to the SQL statement modification information, so as to optimize the SQL statement and obtain an optimized SQL statement.
In this embodiment, the SQL statement with problems is automatically optimized according to the optimization strategy, so that the optimization efficiency is improved, and the optimization time is reduced.
Example IV
Fig. 4 is a flow chart of an SQL statement optimization method provided in the fourth embodiment of the present invention, as shown in fig. 4, based on the SQL statement optimization method provided in the third embodiment of the present invention, step 1041 is further refined, and the method includes the following steps:
step 1041a, obtaining a mapping relationship between the preset audit deduction item and the optimization strategy.
In this embodiment, the audit deduction item is a deducted audit item, the audit item and audit score are preset by the user, and the user gives different audit scores according to the severity of the problem of each audit item.
It should be noted that, the audit item and audit score may be updated according to the user's settings.
Step 1041b, determining a matched optimization strategy according to the audit deduction item and the mapping relation between the preset audit deduction item and the optimization strategy.
In the embodiment, according to the audit deduction item in the audit result, searching an optimization strategy matched with the audit deduction item in a mapping relation between the preset audit deduction item and the optimization strategy, and further optimizing the SQL statement according to the matched optimization strategy.
Example five
Fig. 5 is a flow chart of an SQL statement optimization method provided in a fifth embodiment of the present invention, as shown in fig. 5, based on the SQL statement optimization method provided in a third embodiment of the present invention, step 1042 is further refined, which includes the following steps:
step 1042a, adopting a matched optimization strategy to adjust the SQL sentence to obtain an adjusted SQL sentence, and adopting an SQL auditing strategy to audit the adjusted SQL sentence to obtain a corresponding auditing result.
In this embodiment, a matching optimization strategy is adopted to adjust the SQL statement with a problem, so as to obtain an adjusted SQL statement, and the SQL statement is audited again, and the adjusted SQL statement is audited again by adopting an SQL audit strategy, so that a corresponding audit result is further obtained.
Step 1042b, determining whether to optimize the adjusted SQL statement according to the auditing result.
In this embodiment, whether the adjusted SQL statement has a problem is determined according to the obtained auditing result, if the adjusted SQL statement does not have a problem, the SQL statement does not need to be optimized again, the user is further informed that the adjusted SQL statement does not have a problem, prompt information that the SQL statement is audited and passed can be sent to the user terminal, the adjusted SQL statement is sent to the user terminal, and the adjusted SQL statement can be directly used.
It should be noted that, the problem SQL statement is adjusted according to the optimization policy, and the obtained adjusted SQL statement is usually not problematic, but it is also possible that the adjusted SQL statement is problematic, at this time, the adjusted SQL statement may be sent to the user terminal to audit the failed prompt information, and the original SQL statement and the adjusted SQL statement may be sent to the user terminal.
If not, the adjusted SQL statement is determined to be the optimized SQL statement.
In this embodiment, if the adjusted SQL statement has no problem, the SQL statement does not need to be optimized again, the adjusted SQL statement is determined to be an optimized SQL statement, the optimized SQL statement is sent to the user terminal, and the user can directly use the optimized SQL statement to execute the corresponding operation.
Example six
Fig. 6 is a flow chart of an SQL statement optimization method provided in the sixth embodiment of the present invention, as shown in fig. 6, based on the SQL statement optimization method provided in the fifth embodiment of the present invention, after step 1042b, the method further includes the following steps:
and step 1042d, if yes, sending the auditing result to the user terminal so that the user terminal feeds back the optimizing strategy according to the auditing result.
In this embodiment, if the adjusted SQL statement has a problem, the SQL statement needs to be optimized again, the audit result is sent to the user terminal, the user checks the audit result through the user terminal, generates a corresponding optimization suggestion according to the audit result, generates an optimization policy according to the optimization suggestion, and feeds the optimization policy back to the SQL statement optimizing device.
Or sending the adjusted SQL statement and the auditing result to the user terminal, checking the adjusted SQL statement and the auditing result by the user through the user terminal, modifying the adjusted SQL statement by the user, generating an optimization strategy according to the modified SQL statement, and feeding back the optimization strategy to the SQL statement optimizing device.
Step 1042e, optimizing the adjusted SQL sentence by adopting an optimization strategy fed back by the user terminal to obtain an optimized SQL sentence.
In this embodiment, an optimization policy fed back by the user terminal is received, and the adjusted SQL statement is optimized by adopting the optimization policy fed back by the user terminal, so as to further obtain an optimized SQL statement.
Optionally, after step 1042d, the following steps are further included:
step 1042f, adding the optimization strategy fed back by the user terminal to the corresponding optimization strategy to update the corresponding optimization strategy.
In this embodiment, an optimization policy fed back by the user terminal is received, and the optimization policy fed back by the user terminal is added to an optimization policy corresponding to a corresponding audit deduction item, so that a preset optimization policy is updated, so as to provide more optimization policies for auditing of the subsequent SQL statement.
Example seven
Fig. 7 is a flow chart of an SQL statement optimization method provided in the seventh embodiment of the present invention, as shown in fig. 7, based on the SQL statement optimization method provided in the foregoing embodiment of the present invention, step 102 is further refined, and includes the following steps:
and 1021, auditing the SQL statement to be audited according to the grammar audit policy to obtain a grammar audit result, and auditing the SQL statement to be audited according to the execution plan policy to obtain an execution plan audit result.
In this embodiment, the preset SQL audit policy includes a syntax audit policy and an execution plan audit policy, where the SQL audit policy includes at least one syntax audit item, and the execution plan audit policy includes at least one execution plan audit item, and performs syntax audit on an SQL statement to be audited according to the syntax audit item corresponding to the syntax audit policy, so as to obtain a syntax audit result, and performs execution plan audit on the SQL statement according to the execution plan audit item corresponding to the execution plan audit policy, so as to obtain an execution plan audit result.
Step 1022, generating corresponding auditing results according to the grammar auditing results and the execution plan auditing results.
In this embodiment, a final audit result is obtained according to the obtained grammar audit result and the execution plan audit result, where the audit result includes audit deduction items, audit score items and audit scores corresponding to the items.
Example eight
Fig. 8 is a flow chart of an SQL statement optimization method provided by an eighth embodiment of the present invention, as shown in fig. 8, based on the SQL statement optimization method provided by the seventh embodiment of the present invention, further refines a syntax audit result obtained by auditing an SQL statement to be audited according to a syntax audit policy in step 1021, including the following steps:
And 1021a, determining an audit deduction item and/or an audit score item corresponding to the SQL statement according to at least one grammar audit item in the grammar audit policy.
In this embodiment, the grammar auditing policy at least includes one grammar auditing item, where the grammar auditing item includes one or more items of field type, index column, number of association tables corresponding to association, number of fields, and filtering condition, and an auditing deduction item and/or an auditing score item corresponding to the SQL sentence is determined according to at least one grammar auditing item.
Optionally, determining an audit deduction item and/or an audit score item corresponding to the SQL statement according to at least one grammar audit item in the grammar audit policy, and specifically comprising the following steps:
judging whether the field type corresponding to the SQL statement is the same as the preset field type, if not, determining that the field type is an audit score item, and if so, determining that the field type is an audit deduction item;
and/or judging whether the index column corresponding to the SQL sentence has a corresponding preset function, if so, determining the index column as an audit score item, and if not, determining the index column as an audit deduction item;
And/or judging whether the quantity of the conjunctions corresponding to the SQL statement exceeds the quantity of the preset conjunctions, if so, determining that the quantity of the conjunctions is an audit score item, and if not, determining that the quantity of the conjunctions is an audit deduction item;
and/or judging whether the number of association tables corresponding to the association corresponding to the SQL sentence exceeds the preset association table number, if so, determining the number of association tables corresponding to the association as an audit score item, and if not, determining the number of association tables corresponding to the association as an audit deduction item;
and/or judging whether the field number of the SQL statement query is the preset field number, if so, determining that the field number is an audit score item, and if not, determining that the field number is an audit deduction item;
and/or judging whether the filtering condition corresponding to the SQL sentence is a preset filtering condition, if so, determining that the SQL sentence is an audit score item, and if not, determining that the filtering condition is an audit deduction item.
The preset field types, the preset functions, the preset number of the complexes, the association table corresponding to the complexes and the field number are set according to actual conditions.
And 1021b, determining grammar audit scores according to the audit deduction items and/or the audit score items.
In this embodiment, the audit deduction item does not score, the audit score corresponding to the audit deduction item is zero, the audit score item scores, the audit score corresponding to the audit score item is preset, and the audit deduction item and/or the audit score item are used as grammar audit scores. For example, the audit score corresponding to the field type is 1 point, the audit score corresponding to the index column is 2 points, the audit score corresponding to the number of the association is 1 point, the audit score corresponding to the number of the association table corresponding to the association is 0.5 point, the audit score corresponding to the field number is 0.2 point, and the audit score corresponding to the filtering condition is 1 point.
Note that, the audit score corresponding to each item is not limited to the above-mentioned value, but may be other suitable values, and the corresponding audit score is set according to the occupation ratio of each item in the grammar audit policy. The audit items are set according to actual needs, and are not limited to the audit items, but can be other suitable audit items.
And 1021c, generating a grammar audit result according to the audit deduction item and/or the audit score item and the grammar audit score.
In this embodiment, a grammar audit result is generated according to the audit deduction item and/or the audit score item and the grammar audit score, the grammar audit result is an evaluation on the semantic or grammar aspect of the SQL statement, and the user can check the grammar audit result to obtain the specific condition of each audit item.
Example nine
Fig. 9 is a flow chart of an SQL statement optimization method provided by a ninth embodiment of the present invention, as shown in fig. 9, on the basis of the SQL statement optimization method provided by the seventh embodiment of the present invention, the step 1021 of auditing the SQL statement to be audited according to an execution plan policy to obtain an audit result of the execution plan is further refined, and the method includes the following steps:
1021d, determining audit deduction items and/or audit score items corresponding to the SQL statement according to at least one execution plan audit item in the execution plan audit policy.
In this embodiment, the execution plan audit policy includes at least one execution plan audit item, where the execution plan audit item includes one or more items of a database, a full table scan, an index jump scan, an index full scan, and a cartesian product connection, and an audit deduction item and/or an audit score item corresponding to the SQL statement is determined according to the at least one execution plan audit item.
Optionally, determining an audit deduction item and/or an audit score item corresponding to the SQL statement according to at least one execution plan audit item in the execution plan audit policy, and specifically including the following steps:
Judging whether a database corresponding to an execution plan corresponding to the SQL sentence is consistent with a database corresponding to the auditing request, if so, determining that the database is an auditing score item, and if not, determining that the database is an auditing deduction item;
and/or judging whether the execution plan corresponding to the SQL statement has full-table scanning, if so, determining the full-table scanning as an audit score item, and if not, determining the full-table scanning as an audit deduction item;
and/or judging whether the index jump scanning exists in the execution plan corresponding to the SQL sentence, and obtaining a corresponding judgment result, if so, determining the index jump scanning as an audit score item, and if not, determining the index jump scanning as an audit deduction item;
and/or judging whether the execution plan corresponding to the SQL sentence has index full scan or not, and obtaining a corresponding judgment result, if so, determining the index full scan as an audit score item, and if not, determining the index full scan as an audit deduction item;
and/or judging whether the execution plan corresponding to the SQL sentence has the Cartesian product connection, if yes, determining the Cartesian product connection as an audit score item, and if not, determining the Cartesian product connection as an audit deduction item.
1021e, determining the audit score of the execution plan according to the audit deduction item and/or the audit score item.
In this embodiment, the audit deduction item does not score, the audit score corresponding to the audit deduction item is zero, the audit score item scores, the audit score corresponding to the audit score item is preset, and the audit deduction item and/or the audit score item are used as the execution plan audit score. For example, the audit score corresponding to the database is 0.2 point, the audit score corresponding to the full table scan is 2 point, the audit score corresponding to the index jump scan is 1 point, the audit score corresponding to the index full scan is 2 point, and the audit score corresponding to the cartesian product connection is 1 point.
The audit score corresponding to each item is not limited to the above values, but may be other suitable values, and the corresponding audit score may be set according to the ratio of each item in the execution plan audit policy. The audit items are set according to actual needs, and are not limited to the audit items, but can be other suitable audit items.
1021f, generating an execution plan audit result according to the audit deduction item and/or the audit score item and the execution plan audit score.
In this embodiment, an execution plan audit result is generated according to the audit deduction item and/or the audit score item and the execution plan audit score, where the execution plan audit result is an evaluation on the execution aspect of the SQL statement, and the user may check the execution plan audit result to learn about the specific situation of each audit item.
Fig. 10 is a schematic structural diagram of an SQL statement optimization device 200 according to an embodiment of the invention, and as shown in fig. 10, the SQL statement optimization device 200 provided in this embodiment includes a request receiving unit 201, an auditing unit 202, a determining unit 203, and an optimizing unit 204.
The request receiving unit 201 is configured to receive an SQL statement audit request, and obtain an SQL statement to be audited according to the SQL statement audit request. And the auditing unit 202 is used for auditing the SQL statement to be audited by adopting a preset SQL auditing strategy to obtain a corresponding auditing result. And the determining unit 203 is used for determining whether to optimize the SQL sentence according to the auditing result. And the optimizing unit 204 is used for optimizing the SQL sentence according to the audit deduction item corresponding to the audit result if yes.
Optionally, the determining unit 203 is further configured to obtain an audit score corresponding to the audit result, and determine whether the audit score is equal to a preset score; if yes, determining that SQL sentences do not need to be optimized; if not, determining to optimize the SQL sentence.
Optionally, the optimizing unit 204 is further configured to determine a matched optimizing policy according to the audit deduction item; and optimizing the SQL sentence by adopting a matched optimization strategy to obtain an optimized SQL sentence.
Optionally, the optimizing unit 204 is further configured to obtain a mapping relationship between a preset audit deduction item and an optimizing policy; and determining a matched optimization strategy according to the audit deduction item and the mapping relation between the preset audit deduction item and the optimization strategy.
Optionally, the optimizing unit 204 is further configured to adjust the SQL statement by using a matched optimizing policy to obtain an adjusted SQL statement, and audit the adjusted SQL statement by using an SQL audit policy to obtain a corresponding audit result; determining whether to optimize the adjusted SQL statement according to the auditing result; if not, the adjusted SQL statement is determined to be the optimized SQL statement.
Optionally, the optimizing unit 204 is further configured to send the auditing result to the user terminal if yes, so that the user terminal feeds back the optimizing policy according to the auditing result; and optimizing the adjusted SQL sentence by adopting an optimization strategy fed back by the user terminal so as to obtain an optimized SQL sentence.
Optionally, the SQL statement optimization apparatus 200 further includes: and an updating unit.
The updating unit is used for adding the optimization strategy fed back by the user terminal into the corresponding optimization strategy so as to update the corresponding optimization strategy.
Optionally, the auditing unit 202 is further configured to audit the SQL statement to be audited according to the syntax auditing policy to obtain a syntax auditing result, and audit the SQL statement to be audited according to the execution planning policy to obtain an execution planning auditing result; and generating a corresponding auditing result according to the grammar auditing result and the execution plan auditing result.
Optionally, the auditing unit 202 is further configured to determine an audit deduction item and/or an audit score item corresponding to the SQL statement according to at least one grammar audit item in the grammar audit policy; determining grammar audit scores according to audit deduction items and/or audit score items; and generating grammar audit results according to the audit deduction items and/or the audit score items and the grammar audit scores.
Optionally, the auditing unit 202 is further configured to determine an audit deduction item and/or an audit score item corresponding to the SQL statement according to at least one execution plan audit item in the execution plan audit policy; determining an execution plan audit score according to the audit deduction item and/or the audit score item; and generating an execution plan audit result according to the audit deduction item and/or the audit score item and the execution plan audit score.
Fig. 11 is a first block diagram of an electronic device for implementing the SQL statement optimization method according to an embodiment of the invention, and as shown in fig. 11, the electronic device 300 includes: a memory 301, and a processor 302.
Memory 301 stores computer-executable instructions;
the processor executes 302 the computer-executable instructions stored in the memory to cause the processor to perform the method provided in any one of the embodiments described above.
Fig. 12 is a second block diagram of an electronic device, which may be a computer, a digital broadcasting terminal, a messaging device, a tablet device, a personal digital assistant, a server cluster, etc., as shown in fig. 12, for implementing the SQL statement optimization method of the embodiment of the invention.
Electronic device 400 may include one or more of the following components: a processing component 402, a memory 404, a power supply component 406, an input/output (I/O) interface 408, a sensor component 410, and a communication component 412.
The processing component 402 generally controls overall operation of the electronic device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more communication components 414 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components.
The memory 404 is configured to store various types of data to support operations at the electronic device 400. Examples of such data include instructions for any application or method operating on electronic device 400, contact data, phonebook data, messages, pictures, videos, and the like. The memory 404 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 406 provides power to the various components of the electronic device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 400.
The I/O interface 408 provides an interface between the processing component 402 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 410 includes one or more sensors for providing status assessment of various aspects of the electronic device 400. For example, the sensor assembly 410 may detect an on/off state of the electronic device 400, a relative positioning of the components, such as a display and keypad of the electronic device 400, the sensor assembly 410 may also detect a change in position of the electronic device 400 or a component of the electronic device 400, the presence or absence of a user's contact with the electronic device 400, an orientation or acceleration/deceleration of the electronic device 400, and a change in temperature of the electronic device 400. The sensor assembly 410 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 410 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 410 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 412 is configured to facilitate communication between the electronic device 400 and other devices, either wired or wireless. The electronic device 400 may access a wireless network based on a communication standard, such as WiFi,2G, or 3G, or a combination thereof. In one exemplary embodiment, the communication component 412 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 412 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a computer-readable storage medium is also provided, such as memory 404, that includes instructions executable by communication component 414 of electronic device 400 to perform the above-described method. For example, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, there is also provided a computer-readable storage medium having stored therein computer-executable instructions for performing the method of any one of the above embodiments by a processor.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program for executing the method of any of the above embodiments by a processor.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A method for optimizing an SQL statement, the method comprising:
receiving a Structured Query Language (SQL) statement audit request, and acquiring an SQL statement to be audited according to the SQL statement audit request;
auditing the SQL statement to be audited by adopting a preset SQL audit policy to obtain a corresponding audit result;
determining whether to optimize the SQL statement according to the auditing result;
if yes, automatically optimizing the SQL sentence according to the audit deduction item corresponding to the audit result;
the automatic optimization of the SQL sentence according to the audit deduction item corresponding to the audit result comprises the following steps:
determining a matched optimization strategy according to the audit deduction item;
adjusting the SQL statement by adopting the matched optimization strategy to obtain an adjusted SQL statement, and auditing the adjusted SQL statement by adopting an SQL auditing strategy to obtain a corresponding auditing result;
determining whether to optimize the adjusted SQL statement according to the auditing result;
if yes, the auditing result is sent to a user terminal, so that the user terminal feeds back an optimization strategy according to the auditing result;
optimizing the adjusted SQL sentence by adopting an optimization strategy fed back by the user terminal so as to obtain an optimized SQL sentence;
If not, determining the adjusted SQL statement as an optimized SQL statement;
and sending the auditing result to a user terminal so that the user terminal feeds back an optimization strategy according to the auditing result, and then further comprising:
and adding the optimization strategy fed back by the user terminal into a corresponding optimization strategy to update the corresponding optimization strategy.
2. The method of claim 1, wherein determining whether to optimize the SQL statement based on the audit result comprises:
obtaining an audit score corresponding to the audit result, and determining whether the audit score is equal to a preset score;
if yes, determining that SQL sentences do not need to be optimized;
if not, determining to optimize the SQL sentence.
3. The method of claim 1, wherein the determining a matching optimization strategy based on the audit trail item comprises:
obtaining a mapping relation between a preset audit deduction item and an optimization strategy;
and determining a matched optimization strategy according to the audit deduction item and the mapping relation between the preset audit deduction item and the optimization strategy.
4. A method according to any one of claims 1-3, wherein the preset SQL auditing policies include a grammar auditing policy and an execution plan auditing policy;
The auditing the SQL statement to be audited by adopting a preset SQL auditing strategy to obtain a corresponding auditing result comprises the following steps:
auditing the SQL statement to be audited according to the grammar audit policy to obtain a grammar audit result, and auditing the SQL statement to be audited according to the execution plan policy to obtain an execution plan audit result;
and generating a corresponding auditing result according to the grammar auditing result and the execution plan auditing result.
5. The method of claim 4, wherein the grammar audit policy includes any one or more of the following grammar audit items: the field type, index column, the number of the association, the number of association tables corresponding to the association, the query field and the filtering condition;
the step of auditing the SQL statement to be audited according to the grammar auditing strategy to obtain a grammar auditing result comprises the following steps:
determining audit deduction items and/or audit score items corresponding to the SQL sentences according to at least one grammar audit item in the grammar audit policy;
determining grammar audit scores according to the audit deduction items and/or the audit score items;
and generating a grammar audit result according to the audit deduction item and/or the audit score item and the grammar audit score.
6. The method of claim 4, wherein the execution plan audit policy includes any one or more of the following execution plan audit items: database, full table scan, index jump scan, index full scan and Cartesian product join,
the step of auditing the SQL statement to be audited according to the execution plan strategy to obtain an execution plan auditing result comprises the following steps:
determining audit deduction items and/or audit score items corresponding to the SQL sentences according to at least one execution plan audit item in the execution plan audit policy;
determining an execution plan audit score according to the audit deduction item and/or the audit score item;
and generating an execution plan audit result according to the audit deduction item and/or the audit score item and the execution plan audit score.
7. An SQL statement optimization apparatus, the apparatus comprising:
the request receiving unit is used for receiving an SQL statement auditing request and acquiring an SQL statement to be audited according to the SQL statement auditing request;
the auditing unit is used for auditing the SQL statement to be audited by adopting a preset SQL auditing strategy to obtain a corresponding auditing result;
The determining unit is used for determining whether the SQL sentence is optimized or not according to the auditing result;
the optimizing unit is used for automatically optimizing the SQL sentence according to the audit deduction item corresponding to the audit result if the SQL sentence is the same as the SQL sentence;
the optimizing unit is also used for determining a matched optimizing strategy according to the auditing deduction item;
adjusting the SQL statement by adopting the matched optimization strategy to obtain an adjusted SQL statement, and auditing the adjusted SQL statement by adopting an SQL auditing strategy to obtain a corresponding auditing result;
determining whether to optimize the adjusted SQL statement according to the auditing result;
if yes, the auditing result is sent to a user terminal, so that the user terminal feeds back an optimization strategy according to the auditing result;
optimizing the adjusted SQL sentence by adopting an optimization strategy fed back by the user terminal so as to obtain an optimized SQL sentence;
if not, determining the adjusted SQL statement as an optimized SQL statement;
the SQL sentence optimizing device further comprises: an updating unit;
the updating unit is configured to add the optimization strategy fed back by the user terminal to a corresponding optimization strategy, so as to update the corresponding optimization strategy.
8. An SQL statement optimization device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the method of any one of claims 1-6.
9. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-6.
CN202110865659.3A 2021-07-29 2021-07-29 SQL sentence optimization method, device, equipment, storage medium and product Active CN113590647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110865659.3A CN113590647B (en) 2021-07-29 2021-07-29 SQL sentence optimization method, device, equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110865659.3A CN113590647B (en) 2021-07-29 2021-07-29 SQL sentence optimization method, device, equipment, storage medium and product

Publications (2)

Publication Number Publication Date
CN113590647A CN113590647A (en) 2021-11-02
CN113590647B true CN113590647B (en) 2024-02-23

Family

ID=78252008

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110865659.3A Active CN113590647B (en) 2021-07-29 2021-07-29 SQL sentence optimization method, device, equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN113590647B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115659325B (en) * 2022-09-28 2023-08-08 北京亚控科技发展有限公司 Audit method, electronic device and storage medium
CN116501764B (en) * 2023-06-27 2023-08-25 深圳联友科技有限公司 Automatic SQL optimization method based on generated pre-training model

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714984A (en) * 2013-12-17 2015-06-17 中国移动通信集团湖南有限公司 Database optimization method and device
CN104778277A (en) * 2015-04-30 2015-07-15 福州大学 RDF (radial distribution function) data distributed type storage and querying method based on Redis
AU2014317834A1 (en) * 2013-09-09 2016-03-10 Michael M. Abecassis Methods and systems for analysis of organ transplantation
CN105989137A (en) * 2015-02-27 2016-10-05 中国移动通信集团河北有限公司 Structured query language performance optimization method and system
CN106980637A (en) * 2016-09-28 2017-07-25 平安科技(深圳)有限公司 SQL checking methods and device
CN107480553A (en) * 2017-07-28 2017-12-15 北京明朝万达科技股份有限公司 A kind of data exploration system, method, equipment and storage medium
CN108415991A (en) * 2018-02-12 2018-08-17 广州市贝聊信息科技有限公司 A kind of SQL checking methods and system
CN108509530A (en) * 2018-03-14 2018-09-07 武汉斗鱼网络科技有限公司 A kind of slow query statement automatic optimization method of MySQL, computer equipment and storage medium
CN108595721A (en) * 2018-08-01 2018-09-28 四川长虹电器股份有限公司 A kind of SQL optimization systems and automation SQL optimization methods
CN110019313A (en) * 2017-12-30 2019-07-16 中国移动通信集团四川有限公司 Method for optimizing resources, device, equipment and medium
CN110675269A (en) * 2019-08-16 2020-01-10 阿里巴巴集团控股有限公司 Text auditing method and device
CN111126965A (en) * 2019-12-25 2020-05-08 深圳前海环融联易信息科技服务有限公司 Audit rule optimization method and device, computer equipment and storage medium
CN111340637A (en) * 2020-03-18 2020-06-26 浙江网新恩普软件有限公司 Medical insurance intelligent auditing system based on machine learning feedback rule enhancement
CN111831687A (en) * 2020-06-24 2020-10-27 平安普惠企业管理有限公司 Data query optimization method and device, computer equipment and storage medium
CN112559554A (en) * 2020-12-24 2021-03-26 北京百家科技集团有限公司 Query statement optimization method and device
CN112783914A (en) * 2019-11-01 2021-05-11 北京京东振世信息技术有限公司 Statement optimization method and device
CN112988504A (en) * 2021-02-08 2021-06-18 北京奇艺世纪科技有限公司 Alarm strategy setting method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8903801B2 (en) * 2007-09-14 2014-12-02 Oracle International Corporation Fully automated SQL tuning
US11593370B2 (en) * 2019-09-30 2023-02-28 The Travelers Indemnity Company Systems and methods for dynamic query prediction and optimization

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2014317834A1 (en) * 2013-09-09 2016-03-10 Michael M. Abecassis Methods and systems for analysis of organ transplantation
CN104714984A (en) * 2013-12-17 2015-06-17 中国移动通信集团湖南有限公司 Database optimization method and device
CN105989137A (en) * 2015-02-27 2016-10-05 中国移动通信集团河北有限公司 Structured query language performance optimization method and system
CN104778277A (en) * 2015-04-30 2015-07-15 福州大学 RDF (radial distribution function) data distributed type storage and querying method based on Redis
CN106980637A (en) * 2016-09-28 2017-07-25 平安科技(深圳)有限公司 SQL checking methods and device
CN107480553A (en) * 2017-07-28 2017-12-15 北京明朝万达科技股份有限公司 A kind of data exploration system, method, equipment and storage medium
CN110019313A (en) * 2017-12-30 2019-07-16 中国移动通信集团四川有限公司 Method for optimizing resources, device, equipment and medium
CN108415991A (en) * 2018-02-12 2018-08-17 广州市贝聊信息科技有限公司 A kind of SQL checking methods and system
CN108509530A (en) * 2018-03-14 2018-09-07 武汉斗鱼网络科技有限公司 A kind of slow query statement automatic optimization method of MySQL, computer equipment and storage medium
CN108595721A (en) * 2018-08-01 2018-09-28 四川长虹电器股份有限公司 A kind of SQL optimization systems and automation SQL optimization methods
CN110675269A (en) * 2019-08-16 2020-01-10 阿里巴巴集团控股有限公司 Text auditing method and device
CN112783914A (en) * 2019-11-01 2021-05-11 北京京东振世信息技术有限公司 Statement optimization method and device
CN111126965A (en) * 2019-12-25 2020-05-08 深圳前海环融联易信息科技服务有限公司 Audit rule optimization method and device, computer equipment and storage medium
CN111340637A (en) * 2020-03-18 2020-06-26 浙江网新恩普软件有限公司 Medical insurance intelligent auditing system based on machine learning feedback rule enhancement
CN111831687A (en) * 2020-06-24 2020-10-27 平安普惠企业管理有限公司 Data query optimization method and device, computer equipment and storage medium
CN112559554A (en) * 2020-12-24 2021-03-26 北京百家科技集团有限公司 Query statement optimization method and device
CN112988504A (en) * 2021-02-08 2021-06-18 北京奇艺世纪科技有限公司 Alarm strategy setting method and device, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A novel approach for SQL query optimization;F. Mithani 等;《2016 IEEE International Conference on Computational Intelligence and Computing Research 》;1-4 *
ORACLE数据库SQL语句性能自动优化研究;韩晔;《天津市电子工业协会.天津市电子工业协会2020年年会论文集》;1-4 *
一种基于元数据静动态数据联合查询方法的研究与实现;曾艳梅 等;《计算机应用与软 件》;第32卷(第1期);59-63+77 *

Also Published As

Publication number Publication date
CN113590647A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN113590647B (en) SQL sentence optimization method, device, equipment, storage medium and product
US9922648B2 (en) Developer voice actions system
CN110908997B (en) Data blood relationship construction method and device, server and readable storage medium
US20050240570A1 (en) Partial query caching
US10942926B2 (en) Identification, and query, of semantically-related database tables
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
US10282437B2 (en) Partial indexes for partitioned tables
KR100671506B1 (en) A mobile middleware and a method for processing business logic using it
CN110019314B (en) Dynamic data packaging method based on data item analysis, client and server
CN106156088B (en) Index data processing method, data query method and device
EP3413216A1 (en) Multi-user database execution plan caching
US8768913B2 (en) Multi-source searching in a data driven application
CN113051287B (en) Query statement generation method, device, equipment and storage medium
CN112286958B (en) Processing method and system for database query expression
CN111209592A (en) Method and system for controlling data authority based on spliced SQL (structured query language) statement
CN111090434B (en) Page display method and device for custom column
CN116842151A (en) Question-answer model construction, knowledge base creation, question-answer searching method and electronic equipment
CN114138817A (en) Data query method, device, medium and product based on relational database
CN116610697A (en) Query method, storage medium and device for database query statement
US10817272B2 (en) Generation and usage of language-converted script
CN112463792A (en) Data authority control method and device
CN116361184A (en) Data searching method, device, medium and computer equipment
US11227005B2 (en) Gesture-based database actions
CN112783758B (en) Test case library and feature library generation method, device and storage medium
US9495413B2 (en) Systems and methods for accessing data from a database

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
GR01 Patent grant
GR01 Patent grant