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

A database query method and device

A query method and database technology, which are applied in the fields of electrical digital data processing, special data processing applications, instruments, etc., can solve the problems of large system resource consumption, query time consumption process, low query efficiency, etc., so as to reduce the amount of calculation and improve the query efficiency. The effect of efficiency

Active Publication Date: 2017-11-24
GUANGZHOU HUADUO NETWORK TECH
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] For the query process of fields other than the split field, it is necessary to query in multiple or even all sub-databases. Some query requirements will generate intermediate data and additional calculations that are multiple times the query results, resulting in time-consuming query process and system consumption. Too many resources and low query efficiency

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
  • A database query method and device
  • A database query method and device
  • A database query method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0051] The embodiment of the present invention provides a database query method, see figure 1 .

[0052] 101: Receive a query request for the target data table, where the query request includes query conditions;

[0053] 102: Obtain a global index corresponding to the target data table, the global index is the corresponding relationship between split field data and index field data in the target data table, and the index field is other fields in the target data table except the split field;

[0054] 103: Query the split field data that meets the query conditions in the global index;

[0055] 104: In each storage sub-database corresponding to the target data table, query the query record corresponding to the split field data that satisfies the query condition.

[0056]Wherein, in each data table in the database, a global index corresponding to each data table is pre-generated according to query requirements, and there may be one or more global indexes corresponding to each da...

Embodiment 2

[0063] The embodiment of the present invention provides a database query method, see image 3 .

[0064] 301: Receive a query request for a target data table, where the query request includes a query condition.

[0065] Wherein, the query condition in the query request may be a database query statement. Correspondingly, the query statement needs to include the target data table to be queried, the field to be queried and the condition. For example: SELECT*from name WHERE birthday='2011-04-08', where name is the target data table to be queried, birthday is the field to be queried in the name table, and the condition is that the query birthday field belongs to '2011-04- 08' record.

[0066] 302: Obtain a global index corresponding to the target data table. The global index is the corresponding relationship between split field data and index field data in the target data table, and the index fields are other fields in the target data table except the split field.

[0067] Wher...

Embodiment 3

[0091] The embodiment of the present invention provides a database query device, see Figure 5 , the device consists of:

[0092] The first receiving module 501 is configured to receive a query request for the target data table, where the query request includes query conditions;

[0093] The first obtaining module 502 is used to obtain the global index corresponding to the target data table, the global index is the corresponding relationship between the split field data and the index field data in the target data table, and the index field is the split field in the target data table field other than ;

[0094] The first query module 503 is used to query the split field data satisfying the query condition in the global index;

[0095] The second query module 504 is configured to query the query records corresponding to the split field data satisfying the query conditions in each storage sub-database corresponding to the target data table.

[0096] Wherein, the first acquisit...

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 inquiry method and a database inquiry device and belongs to the technical field of the Internet. The method comprises the following steps: receiving an inquiry request aiming at a target data table, wherein the inquiry request comprises an inquiry condition; acquiring a global index corresponding to the target data table, wherein the global index is correspondence of split field data and index field data in the target data table and the index fields comprise other fields in the target data table expect the split fields; inquiring the split field data which satisfy the inquiry condition in the global index; inquiring inquiry records corresponding to the split field data which satisfies the inquiry condition in storage sub-libraries corresponding to the target data table. According to the method and device disclosed by the invention, the calculated quantity in the inquiry process of other fields except the split fields is reduced, and the inquiry efficiency in the inquiry process is improved.

Description

technical field [0001] The invention relates to the field of databases, in particular to a database query method and device. Background technique [0002] With the development of the Internet, the amount of information increases geometrically, the amount of data in the original database is getting larger and larger, and the time consumed by querying the entire data table is getting longer and longer. [0003] In order to reduce the query time of the data table, the original data table is split horizontally with one of the key fields as the split field, the records of the original data table are scattered in multiple sub-databases, and the split field is recorded The corresponding relationship with each sub-library. For example: Table A includes 10,000 records including id, name, creat_time and other fields, and id is used as a split field to split into 10 sub-databases, each of which stores 1,000 records. In the query process for the split field, first query the sub-databa...

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 Patents(China)
IPC IPC(8): G06F17/30
CPCG06F16/2228G06F16/2453G06F16/24535
Inventor 孙佩欣
Owner GUANGZHOU HUADUO NETWORK TECH