CN117708163A - Query method, query device, electronic equipment and computer readable storage medium - Google Patents

Query method, query device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN117708163A
CN117708163A CN202311707615.3A CN202311707615A CN117708163A CN 117708163 A CN117708163 A CN 117708163A CN 202311707615 A CN202311707615 A CN 202311707615A CN 117708163 A CN117708163 A CN 117708163A
Authority
CN
China
Prior art keywords
query
field
sub
data
partitioned
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311707615.3A
Other languages
Chinese (zh)
Inventor
付元宝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202311707615.3A priority Critical patent/CN117708163A/en
Publication of CN117708163A publication Critical patent/CN117708163A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24554Unary operations; Data partitioning operations
    • G06F16/24556Aggregation; Duplicate elimination
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a query method, a query device, electronic equipment and a computer-readable storage medium, comprising the following steps: acquiring a query request, and analyzing the query request to obtain each component field; determining a database table accessed by a query request and a query interval for query according to each component field obtained by analysis; basic information of a database table is obtained, and a field to be partitioned corresponding to a query interval is determined; partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record; generating a first number of sub-query requests based on the first number of sub-tables and the query requests; the database table is queried in parallel through the first number of sub-query requests, and a first number of sub-query results are obtained; and merging the first number of sub-query results. The method and the device can reduce response time of the query and improve query rate.

Description

Query method, query device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a query method, a query device, an electronic device, and a computer readable storage medium.
Background
With the rapid development of computer technology, the global data size is rapidly increasing, massive data is added to a data warehouse every day, and when the data warehouse is queried through SQL (Structured Query Language ), the computing speed is very slow, even the result cannot be computed at all, so that a rapid query method for massive data is needed.
Disclosure of Invention
The embodiment of the invention aims to provide a query method, a query device, electronic equipment and a computer readable storage medium, so as to realize quick query of mass data. The specific technical scheme is as follows:
in a first aspect of the application, there is provided a query method, including:
acquiring a query request, and analyzing the query request to obtain each composition field;
determining a database table accessed by the query request and a query interval for query according to each component field obtained by analysis;
basic information of the database table is obtained, and a field to be partitioned corresponding to the query interval is determined;
partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record;
generating a first number of sub-query requests based on the first number of sub-tables and the query request;
the database table is queried in parallel through the first number of sub-query requests, and a first number of sub-query results are obtained;
and merging the first number of sub-query results.
In one possible implementation manner, the basic information of the database table includes a table name, a data field and a data type;
the field to be partitioned is at least one field in the data fields.
In one possible implementation, the preset rule is determined according to a size of a database table and the query request.
In one possible implementation manner, when the field to be partitioned includes a first data field and a second data field, determining a first data amount corresponding to the first data field and a second data amount corresponding to the second data field;
and determining the data field with larger data volume as a final field to be partitioned based on the sizes of the first data volume and the second data volume.
In a second aspect of the implementation of the present application, there is further provided a query device, including:
the composition field determining module is used for acquiring a query request and analyzing the query request to obtain each composition field;
the determining module is used for determining a database table accessed by the query request and a query interval for query according to each component field obtained by analysis;
the field to be partitioned determining module is used for acquiring basic information of the database table and determining a field to be partitioned corresponding to the query interval;
the sub-table determining module is used for partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record;
the sub-query request generation module is used for generating a first number of sub-query requests based on the first number of sub-tables and the query requests;
the query module is used for querying the database table in parallel through the first number of sub-query requests to obtain a first number of sub-query results;
and the merging module is used for merging the first number of sub-query results.
In one possible implementation manner, the basic information of the database table includes a table name, a data field and a data type;
the field to be partitioned is at least one field in the data fields.
In one possible implementation, the preset rule is determined according to a size of a database table and the query request.
In one possible embodiment, the apparatus further comprises:
the data quantity determining module is used for determining a first data quantity corresponding to the first data field and a second data quantity corresponding to the second data field when the field to be partitioned comprises the first data field and the second data field;
and the final field to be partitioned determining module is used for determining the data field with larger data volume as the final field to be partitioned based on the sizes of the first data volume and the second data volume.
In yet another aspect of the present application, there is provided an electronic device including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the inquiry methods when executing the programs stored in the memory.
In yet another aspect of the application, there is also provided a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements any of the above-described query methods.
In yet another aspect of the implementations of the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the above-described query methods.
The embodiment of the application provides a query method, a query device, electronic equipment and a computer-readable storage medium, comprising the following steps: acquiring a query request, and analyzing the query request to obtain each composition field; determining a database table accessed by the query request and a query interval for query according to each component field obtained by analysis; basic information of the database table is obtained, and a field to be partitioned corresponding to the query interval is determined; partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record; generating a first number of sub-query requests based on the first number of sub-tables and the query request; the database table is queried in parallel through the first number of sub-query requests, and a first number of sub-query results are obtained; and merging the first number of sub-query results. In the embodiment of the application, the database table accessed by the query request and the query interval for query are determined by acquiring and analyzing the query request, so that the field to be partitioned corresponding to the query interval in the database table is determined, the database table is partitioned according to the field to be partitioned and a preset rule to obtain a first number of sub-tables, the query request is further divided into the first number of sub-query requests, parallel query is performed on the first number of sub-tables, and the combined result of the first number of sub-query results is used as the query result, so that the response time of the query can be reduced, and the query rate is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flow chart of a first query method provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a second method for querying according to an embodiment of the present application;
fig. 3 is a third flow chart of a query method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a query device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
With the rapid development of computer technology, the global data size is rapidly increasing, massive data is added to a data warehouse every day, and when the data warehouse is queried through SQL (Structured Query Language ), the computing speed is very slow, even the result cannot be computed at all, so that a rapid query method for massive data is needed.
In order to realize rapid query of mass data, the embodiment of the application provides a query method, which comprises the following steps:
acquiring a query request, and analyzing the query request to obtain each composition field;
determining a database table accessed by the query request and a query interval for query according to each component field obtained by analysis;
basic information of the database table is obtained, and a field to be partitioned corresponding to the query interval is determined;
partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record;
generating a first number of sub-query requests based on the first number of sub-tables and the query request;
the database table is queried in parallel through the first number of sub-query requests, and a first number of sub-query results are obtained;
and merging the first number of sub-query results.
In the embodiment of the application, the database table accessed by the query request and the query interval for query are determined by acquiring and analyzing the query request, so that the field to be partitioned corresponding to the query interval in the database table is determined, the database table is partitioned according to the field to be partitioned and a preset rule to obtain a first number of sub-tables, the query request is further divided into the first number of sub-query requests, parallel query is performed on the first number of sub-tables, and the combined result of the first number of sub-query results is used as the query result, so that the response time of the query can be reduced, and the query rate is improved.
In the following, fig. 1 is a schematic flow chart of a query method in an embodiment of the present application, which includes:
s101, acquiring a query request, and analyzing the query request to obtain each component field.
The query request can be information to be queried, which is input by a user, and is analyzed to obtain each component field corresponding to the query request. In one embodiment, the query request may be parsed by SQL to extract the constituent fields in the query request.
S102, determining a database table accessed by the query request and a query interval for query according to each component field obtained through analysis.
The basic information of the database table comprises a table name, a data field and a data type. The database table is a data place where data is stored, and contains data of a specific entity type. The database table is a two-dimensional network of rows (row) and columns (column). Columns (columns) are also known as data fields (fields); one or more columns form a table; the column names in the same table must be unique; only one data type, e.g., numeric, date, string, can be provided in a column. The same column contains the same type of data and the same row is a data record of a set of related data. The data type is used for describing the data type of the lower value of the data field, and can be specifically be the data type of integer int, single-precision floating point type, double-precision floating point type and yyyy-mm-dd format, such as 1973-12-30 and hh: mm: time type in ss format, as 15:30: 00. yyyy-mm-dd hh: mm: the datetime type of ss format, e.g. 1973-12-30-15: 30: 00. a fixed length string char type, a variable length string varchar type.
A database table is a data matrix made up of columns and rows, which is the basic object of the database. The database table must have a table structure, then have data, and have no data, called an empty table. The database table has at least one column, but may have no rows.
The database table name is required to be unique and not to contain special characters. The table name is used to uniquely identify the database table.
The database table queried in the embodiment of the application can be one table or a plurality of tables.
S103, acquiring basic information of the database table, and determining a field to be partitioned corresponding to the query interval.
SQL describes the contents of an operation in terms of a single statement (SQL statement) made up of a combination of keywords, table names, column names, etc. Keywords refer to english words whose meaning or method of use has been defined in advance. After analyzing the query request through SQL to obtain each component field in the query request, determining a field to be partitioned corresponding to a query interval in the query request in the data fields of the database table, wherein the field to be partitioned is at least one field in the data fields. For example, when the query request requests to query the data records of the scores 80 to 100 and the ages 15 to 20 in the database table 1, the determined fields to be partitioned are the score field and the age field; when the query request requests data of 365 days in the last year in the database table 2, the determined field to be partitioned is the date field.
S104, partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables.
The preset rule is determined according to the size of the database table and the query request, and each sub-table comprises at least one data record. For example, when the query request requests data about 365 days of the last year in the database table 2, the determined field to be partitioned is a date field, if the data amount of the database table 2 includes data about 100 years, the database table 2 may be equally divided into 10 sub-tables, and each sub-table includes data amount of 10 years; if the data amount of database table 2 includes data for 365 days of the last year, database table 2 may be equally divided into 365 sub-tables, each sub-table including data amount of one day. Of course, the database table may be partitioned in an uneven manner, which is not particularly limited herein.
S105, generating a first number of sub-query requests based on the first number of sub-tables and the query requests.
Based on the number of sub-tables, the query request is split into the same number of sub-query requests, and for each sub-query request, the data volume to be queried is greatly reduced, and the query speed is greatly improved.
S106, the database table is queried in parallel through the first number of sub-query requests to obtain a first number of sub-query results;
wherein a sub-query request is used to query a sub-table. After partitioning the database table to obtain a first number of sub-tables, carrying out parallel query on the sub-tables by utilizing sub-query requests equal to the number of the sub-tables, wherein each sub-query request is used for querying at least one data record, one sub-query result can be obtained for querying each sub-table, and the first number of sub-query results can be obtained for querying the first number of sub-tables.
The query speed may be accelerated by translating a query request to a parallel query of the database table with a first number of sub-query requests.
S107, merging the first number of sub-query results.
After the execution of the first number of sub-query requests is completed, a first number of sub-query results are obtained, and the first number of sub-query results are combined, namely the query results of the query requests aiming at the database table.
In the embodiment of the application, the database table accessed by the query request and the query interval for query are determined by acquiring and analyzing the query request, the field to be partitioned corresponding to the query interval in the database table is further determined, the database table is partitioned according to the field to be partitioned and the preset rule to obtain the first number of sub-tables, so that the query request is also divided into the first number of sub-query requests, the first number of sub-tables are queried in parallel, each sub-query request only needs to query the sub-table with smaller data size, the response time of the query can be reduced, and finally the combined result of the first number of sub-query results is used as the query result, thereby realizing quick query, improving the query rate and improving the user experience. The data analysis can be performed more quickly later, so that the relevant strategy can be formulated quickly.
In one example, when the field to be partitioned includes a first data field and a second data field, determining a first data amount corresponding to the first data field and a second data amount corresponding to the second data field;
and determining the data field with larger data volume as a final field to be partitioned based on the sizes of the first data volume and the second data volume.
It will be appreciated that when the query requests a query of data records having a score of 80 to 100 and an age of 15 to 20 in database table 1, the determined fields to be partitioned are the score field and the age field. The score field may correspond to 500 data records, the age field may correspond to 5000 data records, and the amount of data when the query is performed based on the age field may be larger, so the age field may be selected as the final field to be partitioned, and S104 to S106 described above may be performed. Compared with the method of selecting the score field as the field to be partitioned, the method of selecting the age field as the field to be partitioned has better effect on the aspect of partitioning the database table, because the query request is used for querying the data field with smaller data volume, and the calculation time cost is not too large, but if the data volume corresponding to the data field is large, for example, the data of 365 days in the last year is queried through the query request, more calculation time cost is needed, at the moment, the database table is partitioned, and the database table is partitioned, so that the calculation data volume can be greatly reduced, and the query speed is improved.
In the embodiment of the application, under the condition that the field to be partitioned comprises two data fields, the final field to be partitioned is selected by comparing the respective data sizes of the two data fields, and then the database table is partitioned for inquiry based on the final field to be partitioned, so that the calculated data size can be greatly reduced, and the inquiry speed is improved.
While the above description is given taking the case that the field to be partitioned includes two data fields as an example, it is to be understood that the field to be partitioned may also include three data fields, four data fields, five data fields, and so on, when the field to be partitioned includes three data fields, four data fields, and five data fields, implementation may also be performed with reference to the embodiment that the field to be partitioned includes two data fields.
In one example, another flowchart of the query method provided in the embodiment of the present application is described in detail with reference to fig. 2:
firstly, acquiring an SQL query request, then analyzing the SQL query request to acquire a table used by SQL, reading metadata to acquire partition information, wherein the metadata includes information such as table name, data field, data type, table size and the like of the table; since the table is partitioned, the table name, data field, data type, table size, and the like of the table can be used as partition information. The partition is broken down into N SQL executions, each of which is responsible for querying only a portion of the table. For each sub-table query, a sub-query result is obtained, for N sub-table queries, N sub-query results are obtained, and finally N query results are combined to obtain the query result corresponding to the query request.
In one example, another flowchart of the query method provided in the embodiment of the present application is described in detail with reference to fig. 3:
firstly, acquiring an SQL query request, then analyzing the SQL query request to acquire a table used by SQL, reading metadata to acquire partition information, wherein the metadata includes information such as table name, data field, data type, table size and the like of the table; since the table is partitioned, the table name, data field, data type, table size, and the like of the table can be used as partition information. Judging whether a partition field corresponding to the SQL query request exists in the data field or not, specifically, determining the partition field corresponding to the SQL query request in the data field based on the SQL query request, and if the partition field does not exist, directly executing according to the original SQL; the partition, if present, is split into N SQL executions, each of which is responsible for querying only a portion of the table. And finally merging N query results to obtain the query result corresponding to the query request.
In a second aspect, an embodiment of the present application further provides a query device, referring to fig. 4, including:
the composition field determining module 401 is configured to obtain a query request, and parse the query request to obtain each composition field;
a determining module 402, configured to determine, according to each component field obtained by parsing, a database table accessed by the query request and a query interval for performing a query;
a to-be-partitioned field determining module 403, configured to obtain basic information of the database table, and determine a to-be-partitioned field corresponding to the query interval;
the sub-table determining module 404 is configured to partition the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record;
a sub-query request generating module 405, configured to generate a first number of sub-query requests based on the first number of sub-tables and the query request;
a query module 406, configured to query the database table in parallel through the first number of sub-query requests to obtain a first number of sub-query results;
the merging module 407 is configured to merge the first number of sub-query results.
In one example, the basic information of the database table includes a table name, a data field, and a data type;
the field to be partitioned is at least one field in the data fields.
In one example, the preset rule is determined according to a size of a database table and the query request.
In one example, the apparatus further comprises:
the data quantity determining module is used for determining a first data quantity corresponding to the first data field and a second data quantity corresponding to the second data field when the field to be partitioned comprises the first data field and the second data field;
and the final field to be partitioned determining module is used for determining the data field with larger data volume as the final field to be partitioned based on the sizes of the first data volume and the second data volume.
The embodiment of the invention also provides an electronic device, as shown in fig. 5, which comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501 is configured to implement any one of the query methods described below when executing the program stored in the memory 503.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, where a computer program is stored, the computer program implementing the query method according to any of the above embodiments when executed by a processor.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the query method of any of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method of querying, the method comprising:
acquiring a query request, and analyzing the query request to obtain each composition field;
determining a database table accessed by the query request and a query interval for query according to each component field obtained by analysis;
basic information of the database table is obtained, and a field to be partitioned corresponding to the query interval is determined;
partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record;
generating a first number of sub-query requests based on the first number of sub-tables and the query request;
the database table is queried in parallel through the first number of sub-query requests, and a first number of sub-query results are obtained;
and merging the first number of sub-query results.
2. The method of claim 1, wherein the basic information of the database table includes table name, data field, data type;
the field to be partitioned is at least one field in the data fields.
3. The method of claim 1, wherein the predetermined rule is determined based on a size of a database table and the query request.
4. The method according to claim 2, wherein the method further comprises:
when the field to be partitioned comprises a first data field and a second data field, determining a first data volume corresponding to the first data field and a second data volume corresponding to the second data field;
and determining the data field with larger data volume as a final field to be partitioned based on the sizes of the first data volume and the second data volume.
5. A query device, the device comprising:
the composition field determining module is used for acquiring a query request and analyzing the query request to obtain each composition field;
the determining module is used for determining a database table accessed by the query request and a query interval for query according to each component field obtained by analysis;
the field to be partitioned determining module is used for acquiring basic information of the database table and determining a field to be partitioned corresponding to the query interval;
the sub-table determining module is used for partitioning the database table according to the field to be partitioned and a preset rule to obtain a first number of sub-tables; each sub-table comprises at least one data record;
the sub-query request generation module is used for generating a first number of sub-query requests based on the first number of sub-tables and the query requests;
the query module is used for querying the database table in parallel through the first number of sub-query requests to obtain a first number of sub-query results;
and the merging module is used for merging the first number of sub-query results.
6. The apparatus of claim 5, wherein the basic information of the database table includes a table name, a data field, a data type;
the field to be partitioned is at least one field in the data fields.
7. The apparatus of claim 5, wherein the predetermined rule is determined based on a size of a database table and the query request.
8. The apparatus of claim 6, wherein the apparatus further comprises:
the data quantity determining module is used for determining a first data quantity corresponding to the first data field and a second data quantity corresponding to the second data field when the field to be partitioned comprises the first data field and the second data field;
and the final field to be partitioned determining module is used for determining the data field with larger data volume as the final field to be partitioned based on the sizes of the first data volume and the second data volume.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-4 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-4.
CN202311707615.3A 2023-12-13 2023-12-13 Query method, query device, electronic equipment and computer readable storage medium Pending CN117708163A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311707615.3A CN117708163A (en) 2023-12-13 2023-12-13 Query method, query device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311707615.3A CN117708163A (en) 2023-12-13 2023-12-13 Query method, query device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117708163A true CN117708163A (en) 2024-03-15

Family

ID=90154701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311707615.3A Pending CN117708163A (en) 2023-12-13 2023-12-13 Query method, query device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117708163A (en)

Similar Documents

Publication Publication Date Title
CN110795455B (en) Dependency analysis method, electronic device, computer apparatus, and readable storage medium
US9747349B2 (en) System and method for distributing queries to a group of databases and expediting data access
CN106815353B (en) Data query method and equipment
CN112579610A (en) Multi-data source structure analysis method, system, terminal device and storage medium
US8938442B2 (en) Systems and methods for efficient paging of data
US20230153455A1 (en) Query-based database redaction
CN116881287A (en) Data query method and related equipment
CN112347324B (en) Document query method and device, electronic equipment and storage medium
CN115658680A (en) Data storage method, data query method and related device
US20180341709A1 (en) Unstructured search query generation from a set of structured data terms
US11630829B1 (en) Augmenting search results based on relevancy and utility
CN112687403B (en) Medicine dictionary generation and medicine search method and device
CN116610700A (en) Query statement detection method and device and storage medium
CN110569243B (en) Data query method, data query plug-in and data query server
CN117708163A (en) Query method, query device, electronic equipment and computer readable storage medium
CN115809304A (en) Method and device for analyzing field-level blood margin, computer equipment and storage medium
CN114238387A (en) Data query method and device, electronic equipment and storage medium
WO2008055202A2 (en) System and method for distributing queries to a group of databases and expediting data access
Tao A dynamic I/O-efficient structure for one-dimensional top-k range reporting
CN114282093A (en) Search engine performance evaluation method, device, equipment and storage medium
CN109543079B (en) Data query method and device, computing equipment and storage medium
US20140372457A1 (en) Method and device for processing data
CN112434057B (en) Data query method and device
CN115934825B (en) Data access method, system, electronic device and storage medium based on elastic search
US12130814B2 (en) Late materialization of queried data in database cache

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination