Optimization method and device of non-correlator inquiry
An optimization method and sub-query technology, applied in the computer field, can solve problems such as high time consumption and lower execution efficiency of database query statements, and achieve the effect of saving execution time and improving execution efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] This embodiment will be described from the perspective of an apparatus for optimizing an uncorrelated subquery. Specifically, the apparatus for optimizing an uncorrelated subquery may be integrated in a server, and the server may be a database server or the like.
[0033] A method for optimizing a non-correlated subquery, comprising: determining whether there is a non-correlated subquery statement in a target clause in a database query statement, and if so, obtaining the estimated number of rows of the execution result set corresponding to the target clause, when the predicted When the number of estimated rows is less than the preset threshold, the non-correlated sub-query statement is executed to obtain an execution result set, and the target clause is rewritten according to the execution result set to eliminate the non-correlated sub-query statement.
[0034] Such as Figure 1a As shown, the specific flow of the optimization method of the non-correlated subquery can be...
Embodiment 2
[0132] According to the method described in Embodiment 1, an example will be given below for further detailed description.
[0133] In the embodiment of the present invention, the non-correlated sub-query optimization method provided by the present invention is introduced by taking the non-correlated sub-query optimization device integrated in the server and the database query statement as an SQL statement as an example.
[0134] Such as Figure 2a As shown, a non-correlated subquery optimization method, the specific process can be as follows:
[0135] 201. In the logical optimization stage of the SQL statement, the server determines whether there is a non-correlated subquery statement in the target clause of the SQL statement; if yes, execute step 202, and if not, end the optimization process of the non-correlated subquery.
[0136] Wherein, the target clause may be a clause in which a subquery may appear, such as a WHERE clause, a FROM clause, a JOIN / ON clause, a...
Embodiment 3
[0178] In order to better implement the above method, the embodiment of the present invention also provides an optimization device for non-correlated sub-queries, such as Figure 3a As shown, the device for optimizing the non-correlated subquery includes: a determination unit 301, an acquisition unit 302, an execution unit 303 and a rewriting unit 304, as follows:
[0179] (1) Determining unit 301;
[0180] The determination unit 301 is configured to determine whether there is a non-correlated subquery statement in the target clause of the database query statement.
[0181] Specifically, the determining unit 301 may determine whether there is an irrelevant sub-query statement in the target clause of the database query statement during the logic optimization stage of the database query statement.
[0182] Wherein, the database query statement can be implemented by multiple languages, for example, it can be implemented by SQL (Structured Query Language, Structured Que...
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