Database cursor query method and device, equipment and storage medium

A query method and database technology, applied in the field of devices, database cursor query methods, equipment and storage media, can solve the problems of database system resource waste, database consumption of large storage space, and reduce cursor operation execution time, etc., to achieve reduced time, Improve cursor query efficiency and reduce storage space

Active Publication Date: 2020-10-02
SHANGHAI DAMENG DATABASE
View PDF15 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the above method has some problems when executing large-scale data query. When the cursor operation only needs to process part of the query results to complete the execution, but because the existing cursor operation is based on the query result set corresponding to the query statement, it must wait for all the query results Part of the query results in the query result set can be obtained only after they are generated, which reduces the overall execution time of cursor operations
In addition, due to saving all query result sets, the database needs to consume a large amount of storage space, causing a serious waste of database 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
  • Database cursor query method and device, equipment and storage medium
  • Database cursor query method and device, equipment and storage medium
  • Database cursor query method and device, equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] image 3 It is a flow chart of a database cursor query method provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation where the query result is obtained through the cursor in the database. The method can be executed by a database cursor query device, and the device can use hardware and / or software, see image 3 , the method provided by the embodiment of the present invention generally specifically includes the following steps:

[0030] Step 101, obtain query results according to the query statement, and return the query results in the cache in advance.

[0031] Wherein, the query statement is a structured statement for the database to query the data table, specifically, it may be an SQL query statement, and the syntax of the query statement corresponding to databases of different manufacturers may be different. The query result may be the data queried in the database table according to the query statement, and the query result...

Embodiment 2

[0041] Figure 4It is a flow chart of a database cursor query method provided by Embodiment 2 of the present invention. The embodiment of the present invention is based on the above-mentioned embodiments. Refer to Figure 4 , the database cursor query method provided by the embodiment of the present invention includes the following steps:

[0042] Step 201, obtain query results according to the query statement, and return the query results in the cache in advance.

[0043] In the embodiment of the present invention, due to the limitation of the cache space, the query statement acquires the query results in batches, and the size of the space occupied by each batch of query results may be smaller than or equal to the size of the threshold space. After the virtual machine obtains a batch of query results through the query statement, before generating the result data set, the batch of query results in the cache can be returned in advance.

[0044] Step 202. Determine whether the...

Embodiment 3

[0082] Figure 7 It is a schematic structural diagram of a database query device provided in Embodiment 3 of the present invention, which can execute the database query method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. The device can be implemented by software and / or hardware, and specifically includes: a data query module 301 , a cursor setting module 302 and a result query module 303 .

[0083] The data query module 301 is configured to obtain query results according to query statements, and return the query results in the cache in advance.

[0084] The cursor setting module 302 is configured to set a cursor result set of the cursor according to the returned cache address of the query result.

[0085] The result query module 303 reads the query result according to the cursor.

[0086] In the embodiment of the present invention, the data query module obtains the query result ...

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 database cursor query method and device, equipment and a storage medium, and the method comprises: obtaining a query result according to a query statement, and returning thequery result in a cache in advance; setting a cursor result set of a cursor according to the returned cache address of the query result; and reading the query result according to the vernier. According to the technical scheme of the embodiment of the invention, cursor query operation in the database is realized, the time of waiting for obtaining the query result by the cursor is reduced, the cursor query efficiency is improved, and the storage space of the query result in the database is reduced.

Description

technical field [0001] The embodiments of the present invention relate to the technical field of databases, in particular to a database cursor query method, device, equipment and storage medium. Background technique [0002] In the database, SQL (Structured Query Language, Structured Query Language) scripts often use cursors for data query. Cursors are closely related to SQL query statements. In conventional methods, cursor result sets are associated with query result sets returned by query statements. Cursors and query statements Corresponding to the statement, different query statements correspond to different cursors, correspondingly, the query result sets associated with the cursor result sets are different. In the prior art, the cursor is an important means for the database to perform queries. Opening the cursor means executing the query statement associated with the cursor, generating a query result set according to the query statement, and registering the query result...

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/2455G06F16/242
CPCG06F16/24552G06F16/2425
Inventor 刘静王攀韩朱忠
Owner SHANGHAI DAMENG DATABASE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products