Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Data query method and device in database, equipment and storage medium

A data query and database technology, applied in the database field, can solve problems such as increasing system processing complexity and wasting system resources.

Active Publication Date: 2021-01-08
SHANGHAI DAMENG DATABASE
View PDF10 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, this processing method may cause the following problems: when MAX_OPT_N_TABLES is set to 6, when there are 7 or 8 tables participating in the connection, the tables are divided into two sets such as 6+1 and 6+2, and each set is internally Select the optimal connection method through cost estimation, and then connect the collection, which increases the complexity of system processing and wastes system resources

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
  • Data query method and device in database, equipment and storage medium
  • Data query method and device in database, equipment and storage medium
  • Data query method and device in database, equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0026] figure 1 It is a flowchart of a data query method in a database provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of data query in a database. The method can be executed by a data query device in a database, and specifically includes the following steps:

[0027] Step S110, analyzing the received query statement.

[0028] In this embodiment, a query statement can be understood as a statement generated according to a database query and a programming language for data query, for example, select count(*) from t1.

[0029] When users have query requirements, that is, when they want to obtain information from the database, they input query statements on the application program interface (database software), and the database management system analyzes the syntax and semantics of the query statements.

[0030] Step S120, determine whether there is a where filter condition in the query statement, if yes, execute step S130; otherw...

Embodiment 2

[0045] figure 2 It is a flowchart of a data query method in a database provided by Embodiment 2 of the present invention. The technical solution of this embodiment is further refined on the basis of the above-mentioned technical solution, and specifically mainly includes the following steps:

[0046] Step S210, analyzing the received query statement.

[0047] Step S220, determine whether there is a where filter condition in the query statement, if yes, execute step S230; otherwise, execute step S280.

[0048] Step S230, determining the number of data tables to be queried in the set of tables to be queried in the query statement.

[0049] Step S240, judging whether the query quantity is within the preset quantity range, if yes, perform step S250; otherwise, perform step S280.

[0050] Step S250, for the target data table selected from the set of tables to be queried, judge whether the target data table satisfies the statement conversion condition, if so, execute step S260; ...

Embodiment 3

[0073] image 3 A schematic structural diagram of a device for querying data in a database provided by Embodiment 3 of the present invention, the device includes: an analysis module 31 , a determination module 32 and an optimization module 33 .

[0074] Wherein, the parsing module 31 is used for parsing the received query statement; the determination module 32 is used for determining the query quantity of the data table in the table set to be queried in the query statement when there is a where filter condition in the query statement; An optimization module 33, configured to, when the number of queries is within a preset number range, for the target data table selected from the set of tables to be queried, according to the preset sentence conversion conditions and sentence conversion rules for the The statement associated with the target data table in the query statement is optimized to obtain an optimized query statement, so as to implement data query according to the optimiz...

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 embodiment of the invention discloses a method, a device and equipment for querying data in a database and a storage medium. The method comprises the following steps of analyzing a received querystatement; determining the query quantity of the data tables in the to-be-queried table set of the query statement when the query statement has the were filtering condition; when the query quantity iswithin a preset quantity range, optimizing statements associated with a target data table in the query statements according to preset statement conversion conditions and statement conversion rules for the target data table selected from the to-be-queried table set to obtain optimized query statements, therefore, data query is carried out according to the optimized query statement, the problem that when multiple data tables are queried, when the number of the data tables exceeds the upper limit of the table number of the sets, the multiple sets need to be divided for query is solved, rapid query of data can be achieved without dividing the data tables into the multiple sets, and cost estimation does not need to be carried out multiple times. The method is advantaged in that processing complexity is reduced, resources are saved, and the query speed is increased.

Description

technical field [0001] The embodiments of the present invention relate to the technical field of databases, and in particular, to a data query method, device, equipment and storage medium in a database. Background technique [0002] When performing data query operations in the database, when two or more tables are involved in a structured query language (Structured Query Language, SQL) query statement, it is necessary to perform a join query on these tables. The join operator joins two tables at a time. When N tables participate in the join, N-1 join operations between the two tables will be performed. The order in which each table participates in the join is determined by the optimizer based on cost estimates. As the number of tables participating in the connection increases, the number of possible connection methods increases in the form of permutations and combinations. When a large number of tables participate in the connection, the cost of analyzing these connection me...

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): G06F16/2453G06F16/242G06F16/2455
CPCG06F16/2453G06F16/24564G06F16/2433Y02D10/00
Inventor 韩朱忠朱仲颖孟正凌
Owner SHANGHAI DAMENG DATABASE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products