SQL statement optimization method, device and equipment and storage medium
An optimization method and statement technology, applied in the database field, can solve the problems of low performance and low query efficiency, and achieve the effect of reducing the query scope, reducing the query scale, and improving the query execution efficiency.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0059] figure 1 It is a flow chart of a SQL statement optimization method provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of optimizing SQL statements including common expressions, and the method can be executed by the SQL statement optimization device in the embodiment of the present invention. , the device can be implemented in the form of software and / or hardware, as shown in Figure 1, the method specifically includes the following steps:
[0060] S110, acquiring an SQL query statement input by a user.
[0061] Specifically, the SQL query statement input by the user is obtained, and the syntax analysis is performed on the SQL query statement input by the user.
[0062] S120. If the SQL query statement satisfies a first preset condition, obtain an optimizeable view in the SQL query statement, where the optimizeable view includes a common expression.
[0063] Specifically, if the SQL query statement satisfies the first prese...
Embodiment 2
[0083] figure 2 It is a flow chart of a SQL statement optimization method in Embodiment 2 of the present invention. This embodiment is optimized based on the above embodiments. In this embodiment, the target filter condition is determined according to the optimizeable view, including: if There is an equivalence connection condition in the optimizeable view, and one side of the equivalence connection condition is a public expression, and one side of the equivalence connection condition is a single object, then the first filter condition is determined according to the single object; An IN expression is determined by using the equivalence connection condition and the first filter condition; and the final filter condition is determined according to the IN expression.
[0084] Such as figure 2 As shown, the method of this embodiment specifically includes the following steps:
[0085] S210, acquiring the SQL query statement input by the user.
[0086] S220. If the SQL query sta...
Embodiment 3
[0122] image 3 It is a schematic structural diagram of an SQL statement optimization device provided by Embodiment 3 of the present invention. This embodiment can be applicable to the situation that comprises the SQL statement optimization of common expression, and this device can adopt the mode of software and / or hardware to realize, and this device can be integrated in any equipment that provides the function of SQL statement optimization, such as image 3 As shown, the apparatus for optimizing SQL statements specifically includes: a first obtaining module 310 , a second obtaining module 320 , a determining module 330 and an adding module 340 .
[0123] Wherein, the first obtaining module 310 is used to obtain the SQL query statement input by the user;
[0124] The second acquiring module 320 is configured to acquire an optimizeable view in the SQL query statement if the SQL query statement satisfies a first preset condition, wherein the optimizeable view includes a common...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com