Unlock instant, AI-driven research and patent intelligence for your innovation.

Sorting method of multiple predicates

A predicate and sequence technology, applied in the field of sorting multiple predicates, can solve the problems of low operation efficiency and high CPU overhead, and achieve the effect of reducing overhead and improving execution efficiency.

Inactive Publication Date: 2017-12-08
HANGZHOU WOQU NETWORK TECH
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0011] Aiming at the shortcomings of low operating efficiency and high CPU overhead in the prior art, the present invention provides a method for sorting multiple predicates

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Sorting method of multiple predicates
  • Sorting method of multiple predicates

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] There are columns A, B, and C in table T1 of the database, and they are all integer data. Currently, the SQL to be processed is as follows:

[0050] SELECT A, B, C FROM T1 WHERE A>10 AND power(B, 2)>100 AND power(C, 3)>1000;

[0051] Among them, power is a function for exponentiation, power(B, 2) is to find the square of B, and power(C, 3) is to find the cube of C.

[0052] The statement has gone through the analysis stage and the optimization stage in the database. In the initialization stage of executing the query plan, it is necessary to apply the method proposed in the present invention to the connection condition in the query statement:

[0053]1. Initialize the calculation cost and selection rate of each predicate. Assume that the calculation cost of A>10 is 1, and the selection rate is 40%. The calculation cost of power(B, 2)>100 is 5, and the selection rate is 20%. Power (C,3)>1000 has a computational cost of 10 and a selectivity of 10%. This is also the set o...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a sorting method of multiple predicates, relating to the technical field of database query optimization. The method comprises the following steps: S110, initializing selection rate and CPU overhead of each subexpression of predicates; S120, judging if the present predicate total length is one, stepping out if yes, and entering the next step if not; S130, adding one to present value of N; S140, searching an optimal predicate sequence with the length being N and storing the result to the Nth optimal sequence set; S150, judging if the present value of N is the finally generated length, entering the next step if not, and ending if yes. The method eliminates factors influencing the general predicate calculation cost in the case of multiple predicates, so as to finally obtain a global optimal predicate sequence, reduce CPU overhead in the process of calculating all predicates and further enhance the execution efficiency of the whole query plan.

Description

technical field [0001] The invention relates to the technical field of database query optimization, in particular to a method for sorting multiple predicates. Background technique [0002] At present, the process of processing SQL in the database is mainly divided into three stages: [0003] 1. Analysis stage: In this stage, the database converts the standard structured query statement (SQL) from the client into a data structure recognizable by the database with the help of lexical and grammar analysis tools—the syntax analysis tree. [0004] 2. Query optimization stage: The database applies various optimization methods on the parsing tree (that is, common query rewriting in the database), and then calculates an optimal access path for the tables participating in the connection, and finally generates a structure to represent Optimal query plan. [0005] 3. Execute the query plan stage, execute the optimal query plan, and finally obtain the result. [0006] In the query op...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/2453G06F16/24553
Inventor 余鹏李建辉熊中哲魏兴华臧冰凌李春陈栋张文件罗春
Owner HANGZHOU WOQU NETWORK TECH