WO2015184762A1 - 数据库查询方法及装置 - Google Patents

数据库查询方法及装置 Download PDF

Info

Publication number
WO2015184762A1
WO2015184762A1 PCT/CN2014/094259 CN2014094259W WO2015184762A1 WO 2015184762 A1 WO2015184762 A1 WO 2015184762A1 CN 2014094259 W CN2014094259 W CN 2014094259W WO 2015184762 A1 WO2015184762 A1 WO 2015184762A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
query
structured query
connection
structured
Prior art date
Application number
PCT/CN2014/094259
Other languages
English (en)
French (fr)
Inventor
陈波
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015184762A1 publication Critical patent/WO2015184762A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a database query method and apparatus.
  • the database typically includes one or more database tables for storing data values.
  • a user, application, or remote system In order to retrieve and manipulate data in a database, a user, application, or remote system typically issues a database query to the database management system.
  • a database query is a collection of statements, commands, or clauses used to retrieve data stored in a database. For example, a query can specify a specific location in the database to retrieve data (for example, a table, row, or column), or specify how to join columns from multiple tables.
  • connection query can only use one database connection, for a powerful database server and storage device, only a small amount of processing power can be used; if the number of tables connected to the query is large, each If the amount of table data is large, the query efficiency is very low.
  • the embodiment of the invention provides a database query method and device, so as to at least solve the problem of inefficient querying of database queries when querying multiple tables in the related art.
  • the present invention provides a database query method, including the following steps:
  • the data is obtained from the result set, and the acquired data is spliced at the same time to obtain the query result.
  • the receiving the request for the database multi-table join query after constructing the plurality of structured query statements for the single table according to the request, further comprises:
  • the receiving the request for the database multi-table join query after constructing the plurality of structured query statements for the single table according to the request, further comprises:
  • the step of assigning the structured query statement to the thread corresponding to the database connection includes:
  • the structured query statement corresponding to each segment is allocated to the thread corresponding to the database connection according to a preset allocation rule, and after the execution of the structured query statement belonging to the same segment is completed, Then execute the structured query of the next segment.
  • the preset allocation rule comprises:
  • the unstructured structured query statement is x and the remaining threads are y
  • the x/y is rounded to obtain the integer z
  • the z structured query statements are assigned to one of the remaining threads; the loop is executed. Until all thread allocation ends.
  • the step of allocating a corresponding database connection according to the current database resource, and the connection query for the database comprises:
  • the m/n is rounded to obtain the integer a.
  • the structured query has b, and the a and b are taken.
  • the minimum value c is used to allocate c database connections for the database multi-table join query request, for the database connection query; or
  • an embodiment of the present invention further provides a database query device, where the database query device includes:
  • Constructing a module configured to receive a request for a database multi-table join query, and construct a plurality of structured query statements for a single table according to the request;
  • the database connection allocation module is configured to allocate a corresponding database connection according to the current database resource, and is used for connection query of the database;
  • the structured query statement assigning module is configured to allocate the structured query statement to the thread corresponding to the database connection according to a preset allocation rule
  • a receiving module configured to receive a result set returned by the thread after executing the structured query statement
  • the splicing module is configured to acquire data from the result set, and simultaneously splicing the acquired data to obtain a query result.
  • the database querying device further includes:
  • the sorting module is arranged to sort the key fields of the structured query according to a preset sorting rule.
  • the database querying device further includes:
  • a segmentation module configured to segment the range of the key field of the structured query statement according to a preset segmentation rule, and process the structured query statement according to the result of the segmentation, to generate a corresponding segment Structured query statement;
  • the structured query statement allocation module is further configured to allocate, according to a segmentation order, the structured query statement corresponding to each segment to a thread corresponding to the database connection according to a preset allocation rule, and belong to the same After the execution of the segmented structured query statement is completed, the structured query of the next segment is executed.
  • the preset allocation rule in the structured query statement allocation module includes: when the unallocated structured query statement is x and the remaining threads are y, the x/y is rounded to obtain an integer z. Assign z structured query statements to one of the remaining threads; loop through the allocation rules until all thread allocation ends.
  • the database connection allocation module is configured to: when the remaining database connections for the query function are m, and the remaining user query concurrency is n, the m/n is rounded to obtain an integer a, the structuring The query statement has b, and for a and b take the minimum value c, then allocate c database connections for the database multi-table join query request, for the database connection query; or,
  • the invention allocates multiple database connections for one database query, so that the query multiple tables can be simultaneously performed, fully utilizes the database resources, and greatly improves the query efficiency while satisfying the business statistics.
  • FIG. 1 is a schematic flowchart of a first embodiment of a database query method according to the present invention
  • FIG. 2 is a schematic flowchart of a second embodiment of a database query method according to the present invention.
  • FIG. 3 is a schematic flowchart of a third embodiment of a database query method according to the present invention.
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of a database query apparatus according to the present invention.
  • FIG. 5 is a schematic diagram of functional modules of a second embodiment of a database query apparatus according to the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a third embodiment of a database query apparatus according to the present invention.
  • FIG. 1 is a schematic flowchart diagram of a first embodiment of a database query method according to the present invention.
  • the database query method in this embodiment includes the following steps:
  • Step S10 Receive a request for a database multi-table join query, and construct a plurality of structured query statements for a single table according to the request;
  • Real-time monitoring of the request of the database multi-table connection query sent by the terminal After receiving the request sent by the terminal to the database multi-table connection query, the field and the table information in the request according to the database multi-table connection query are constructed as multiple single tables.
  • the structured query statement stores the structured query statement in memory.
  • the receiving a request for a database multi-table join query configured as a plurality of structured query statements for a single table, may be:
  • Location constructed as two structured query statements for a single table: select begintime, location, a1, a2from A, and select begintime, location, b1, b2from B, querying Table A and Table B, respectively. Or,
  • the request for the database multi-table connection query may include: A table, a1 field, a2 field, B table, b1 field, b2 field in the terminal interface, connection field begintime, location, corresponding to the request according to the database multi-table connection query Query statement rules, respectively construct structured query statements for A and B tables: select begintime, location, a1, a2from A and select begintime, location, b1, b2from B, query Table A and Table B, respectively.
  • Step S11 Allocating a corresponding database connection according to the current database resource, and using the connection query of the database;
  • the database resources may include a database server, performance of the storage device, user concurrency, and the like.
  • the way the database connection is allocated can include:
  • B according to the database server, the performance of the storage device, the current user query concurrency, and one or more resources in the maximum concurrency of the user query, allocate a corresponding database connection for the request of the database multi-table connection query, for Connection query for the database.
  • the current user query concurrency is the number of current user query databases, and the maximum concurrency of the user query is that the database can simultaneously accept the maximum number of user query databases.
  • Step S12 Assign the structured query statement to the thread corresponding to the database connection according to a preset allocation rule
  • the preset allocation rule may be:
  • B read the structured query statement in the memory, the structured query statement has u, the thread has v, round the u / v, obtain the integer w; first assign w to each thread A structured query statement, and then the remaining structured query statements are sequentially assigned to different threads.
  • Step S13 Receive a result set returned by the thread after executing the structured query statement.
  • the result set is a result set, and the result set is stored in the cache.
  • Step S14 Obtain data from the result set, and splicing the acquired data to obtain a query result.
  • the result set is essentially a table, a behavior of the table is a record, a column of the table is a field, and the field includes a key field and a common field except the key field;
  • the query record table is a query result.
  • the multi-table query of the database no longer depends on a single database connection, but flexiblely allocates multiple database connections according to the database resources, and uses these database connections in different threads to perform concurrent query, in meeting the business statistics. At the same time, the query efficiency is greatly improved.
  • FIG. 2 is a schematic flowchart diagram of a second embodiment of a database query method according to the present invention.
  • the request for receiving a query for a database multi-table join in the second embodiment further includes: after constructing a plurality of structured query statements for a single table according to the request:
  • Step S21 Sort the key fields of the structured query according to a preset sorting rule.
  • the preset collation may be sorted in the order of 0 to 9 when the key fields are Arabic numerals, or may be sorted in reverse order; when the key field is Chinese or English, the first letter of the Chinese pinyin or the first of the English may be taken.
  • the letters are sorted in order of a to z, and can also be sorted in reverse order.
  • the structured query statement After sorting the specified key fields in the structured query statement, the structured query statement is assigned to the thread corresponding to the database connection, and the thread stores the result set into the cache while the database is executing, and the database query system reads the result from the cache. The data is spliced while the data is collected. Since the result set after the execution of the structured query statement is sorted by the key field, this is beneficial to improve the stitching efficiency.
  • the key segments are sorted and then queried, and the results are spliced while receiving the result returned by the thread, which greatly reduces memory consumption and improves processing efficiency.
  • FIG. 3 is a schematic flowchart of a third embodiment of a database query method according to the present invention.
  • the database query method in this embodiment may include the following steps:
  • Step S30 Receive a request for a database multi-table join query, and construct a plurality of structured query statements for a single table according to the request;
  • Real-time monitoring of the request of the database multi-table connection query sent by the terminal After receiving the request sent by the terminal to the database multi-table connection query, the field and the table information in the request according to the database multi-table connection query are constructed as multiple single tables. Structured query statement.
  • Step S31 segmenting the range of the key segment of the structured query according to the preset segmentation rule
  • the preset segmentation rule is set to be the maximum value and the minimum value of the numerical value when the key field is an Arabic numeral, and divide it into ten ranges, and the same segment belongs to the same segment; similarly, When the key field is Chinese or English, the first letter of Chinese pinyin and the first letter of English may be segmented; when the key field is time, it may be segmented by year, month, day, hour, minute, etc.
  • Step S32 processing the structured query statement according to the result of the segmentation, and generating a structured query statement corresponding to each segment;
  • the key segment is divided into ten ranges according to the preset segmentation rule, after the original structured query statement is split and reorganized, ten structured query statements are generated, and each structured query statement is responsible for a range.
  • the structured query statement is stored in memory.
  • Step S33 Allocating a corresponding database connection according to the current database resource, for connection query of the database;
  • the database resources may include a database server, performance of the storage device, user concurrency, and the like.
  • Step S34 According to the segmentation order, the structured query statement corresponding to each segment is allocated to the thread corresponding to the database connection according to a preset allocation rule, and the structured query statement belonging to the same segment is executed. After the end, execute the structured query of the next segment;
  • the structured query statement of the same segment in the memory is read.
  • the preset allocation rule has been described in detail in step S12 of the first embodiment, and details are not described herein again.
  • Step S35 Receive a result set returned by the thread after executing the structured query statement.
  • the result set is a result set, and the result set is stored in the cache.
  • Step S36 Obtain data from the result set, and splicing the acquired data to obtain a query result.
  • the multi-table query for the database no longer depends on a single database connection, but flexibly allocates multiple database connections according to the database resources, and uses these database connections to concurrently execute structured query statements in different threads to satisfy the service.
  • the statistics greatly improve the efficiency of the query.
  • the keyword segment is divided into multiple query plans according to the scope, which can achieve the final result of batch return, improve the rendering speed of the home page, and optimize the user experience.
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of a database query apparatus according to the present invention.
  • the database query device 10 in this embodiment includes:
  • the constructing module 11 is configured to receive a request for a database multi-table join query, and construct a plurality of structured query statements for a single table according to the request;
  • Real-time monitoring of the request of the database multi-table connection query sent by the terminal After receiving the request sent by the terminal to the database multi-table connection query, the field and the table information in the request according to the database multi-table connection query are constructed as multiple single tables.
  • the structured query statement stores the structured query statement in memory.
  • the receiving a request for a database multi-table join query configured as a plurality of structured query statements for a single table, may be:
  • Location constructed as two structured query statements for a single table: select begintime, location, a1, a2from A, and select begintime, location, b1, b2from B, querying Table A and Table B, respectively. or,
  • the request for the database multi-table connection query may include: A table, a1 field, a2 field, B table, b1 field, b2 field in the terminal interface, connection field begintime, location, corresponding to the request according to the database multi-table connection query Query statement rules, respectively construct structured query statements for A and B tables: select begintime, location, a1, a2from A and select begintime, location, b1, b2from B, query Table A and Table B, respectively.
  • the database connection allocation module 12 is configured to allocate a corresponding database connection according to the current database resource, and is used for connection query of the database;
  • the corresponding database connection number is allocated for the connection query of the database.
  • the database resources may include a database server, performance of the storage device, user concurrency, and the like.
  • the way the database connection is allocated can include:
  • B according to the database server, the performance of the storage device, the current user query concurrency, and one or more resources in the maximum concurrency of the user query, allocate a corresponding database connection for the request of the database multi-table connection query, for Connection query for the database.
  • the current user query concurrency is the number of current user query databases, and the maximum concurrency of the user query is that the database can simultaneously accept the maximum number of user query databases.
  • the structured query statement assigning module 13 is configured to allocate the structured query statement to the thread corresponding to the database connection according to a preset allocation rule
  • the preset allocation rule may be:
  • B read the structured query statement in the memory, the structured query statement has u, the thread has v, round the u / v, obtain the integer w; first assign w to each thread A structured query statement, and then the remaining structured query statements are sequentially assigned to different threads.
  • the receiving module 14 is configured to receive a result set returned by the thread after executing the structured query statement
  • the result set is a result set, and the result set is stored in the cache.
  • the splicing module 15 is configured to acquire data from the result set, and simultaneously splicing the acquired data to obtain a query result.
  • the result set is essentially a table, a behavior of the table is a record, a column of the table is a field, and the field includes a key field and a common field except the key field;
  • the query record table is a query result.
  • the multi-table query of the database no longer depends on a single database connection, but flexiblely allocates multiple database connections according to the database resources, and greatly improves the query efficiency while satisfying the service statistics.
  • FIG. 5 is a schematic diagram of functional modules of a second embodiment of a database query apparatus according to the present invention.
  • the database querying device in the second embodiment further includes:
  • the sorting module 22 is configured to sort the key fields of the structured query statement according to a preset sorting rule.
  • the preset collation may be sorted in the order of 0 to 9 when the key fields are Arabic numerals, or may be sorted in reverse order; when the key field is Chinese or English, the first letter of the Chinese pinyin or the first of the English may be taken.
  • the letters are sorted in order of a to z, and can also be sorted in reverse order.
  • the structured query statement After sorting the specified key fields in the structured query statement, the structured query statement is assigned to the thread corresponding to the database connection, and the thread stores the result set into the cache while the database is executing, and the database query system reads the result from the cache. The data is spliced while the data is collected. Since the result set after the execution of the structured query statement is sorted by the key field, this is beneficial to improve the stitching efficiency.
  • the key segments are sorted and then queried, and the results are spliced while receiving the result returned by the thread, which greatly reduces memory consumption and improves processing efficiency.
  • FIG. 6 is a schematic diagram of functional modules of a third embodiment of a database query apparatus according to the present invention.
  • the database query device in the third embodiment further includes:
  • the segmentation module 32 is configured to segment the range of the key field of the structured query statement according to a preset segmentation rule and process the structured query statement according to the result of the segmentation, and generate each segmentation Corresponding structured query statement;
  • the preset segmentation rule is set to be the maximum value and the minimum value of the numerical value when the key field is an Arabic numeral, and divide it into ten ranges, and the same segment belongs to the same segment; similarly, When the key field is Chinese or English, the first letter of Chinese pinyin and the first letter of English may be segmented; when the key field is time, it may be segmented by year, month, day, hour, minute, etc.
  • the key segment is divided into ten ranges according to the preset segmentation rule, after the original structured query statement is split and reorganized, ten structured query statements are generated, and each structured query statement is responsible for a range.
  • the structured query statement is stored in memory.
  • the structured query statement assigning module 34 is further configured to allocate, according to a segmentation order, the structured query statement corresponding to each segment to a thread corresponding to the database connection according to a preset allocation rule, and belongs to After the execution of the structured query of the same segment is completed, the structured query of the next segment is executed.
  • the structured query statement of the same segment in the memory is read.
  • the preset allocation rule in the structured query statement allocation module has been described in detail in the structured query statement allocation module 13 of the first embodiment, and is no longer Narration.
  • the multi-table query for the database no longer depends on a single database connection, but flexibly allocates multiple database connections according to the database resources, and uses these database connections to concurrently execute structured query statements in different threads to satisfy the service.
  • the statistics greatly improve the efficiency of the query.
  • the keyword segment is divided into multiple query plans according to the scope, which can achieve the final result of batch return, improve the rendering speed of the home page, and optimize the user experience.
  • a database query method and apparatus provided by an embodiment of the present invention have the following beneficial effects: by allocating multiple database connections for one database query, the query multiple tables can be simultaneously performed, fully utilizing database resources, and satisfying the service. Statistics also greatly improve the efficiency of the query.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (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

本发明公开了一种数据库查询方法,包括接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;接收所述线程执行结构化查询语句后返回的结果集;从结果集中获取数据,同时拼接所获取的数据,获得查询结果。本发明对数据库的多表查询不再依赖单个数据库连接,而是根据数据库资源,灵活分配多条数据库连接,在满足业务统计的同时大大提升了查询效率。

Description

数据库查询方法及装置 技术领域
本发明涉及计算机技术领域,尤其涉及数据库查询方法及装置。
背景技术
数据库通常包括用于存储数据值的一个或多个数据库表格。为了在数据库中检索和操纵数据,用户、应用程序或远程***通常向数据库管理***发出数据库查询。数据库查询是指用于检索存储在数据库中的数据的语句、命令或子句的集合。例如,查询可以在数据库中指定检索数据的特定位置(例如,表格、行或列),或者指定如何联接来自多个表格的列。
对于多表查询,由于一条连接查询语句只能用到一个数据库连接,对于强大的数据库服务器和存储设备,只能使用到其中很小的处理能力;如果所连接查询的表个数多、每个表数据量大,则查询效率很低。
发明内容
本发明实施例提供了一种数据库查询方法及装置,以至少解决相关技术中查询多表时,数据库查询的查询低效率的问题。
为实现上述目的,本发明提供的一种数据库查询方法,包括以下步骤:
接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;
接收所述线程执行结构化查询语句后返回的结果集;
从结果集中获取数据,同时拼接所获取的数据,获得查询结果。
优选地,所述接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句之后还包括:
根据预设的排序规则对结构化查询语句的关键字段排序。
优选地,所述接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句之后还包括:
根据预设的分段规则对结构化查询语句的关键字段的范围进行分段和按分段的结果对所述结构化查询语句进行处理,生成每个分段所对应的结构化查询语句;
按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行的步骤包括:
按照分段顺序,将所述每个分段所对应的结构化查询语句按预设的分配规则分配给所述数据库连接对应的线程执行,且属于同一分段的结构化查询语句执行结束后,再执行下一分段的结构化查询语句。
优选地,所述预设的分配规则包括:
当未分配的结构化查询语句为x个,剩余线程为y时,则对x/y进行取整,获得整数z,将z条结构化查询语句分配到剩余线程中的一个;循环执行该步骤,直到所有的线程分配结束。
优选地,所述根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询的步骤包括:
当剩余用于查询功能的数据库连接为m个,剩余用户查询并发度为n时,则对m/n进行取整,获得整数a,所述结构化查询语句有b条,对a和b取最小值c,则为所述数据库多表连接查询的请求分配c个数据库连接,用于数据库的连接查询;或者,
根据数据库服务器、存储设备的性能、当前用户查询并发度和用户查询最大并发度中的一个或多个资源,为所述数据库多表连接查询的请求分配相应的数据库连接,用于数据库的连接查询。
此外,为实现上述目的,本发明实施例还提供一种数据库查询装置,所述数据库查询装置包括:
构造模块,设置为接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
数据库连接分配模块,设置为根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
结构化查询语句分配模块,设置为按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;
接收模块,设置为接收所述线程执行结构化查询语句后返回的结果集;
拼接模块,设置为从结果集中获取数据,同时拼接所获取的数据,获得查询结果。
优选地,所述数据库查询装置还包括:
排序模块,设置为根据预设的排序规则对结构化查询语句的关键字段排序。
优选地,所述数据库查询装置还包括:
分段模块,设置为根据预设的分段规则对结构化查询语句的关键字段的范围进行分段和按分段的结果对所述结构化查询语句进行处理,生成每个分段所对应的结构化查询语句;
所述结构化查询语句分配模块还设置为按照分段顺序,将所述每个分段所对应的结构化查询语句按预设的分配规则分配给所述数据库连接对应的线程执行,且属于同一分段的结构化查询语句执行结束后,再执行下一分段的结构化查询语句。
优选地,所述结构化查询语句分配模块中预设的分配规则包括:当未分配的结构化查询语句为x个,剩余线程为y时,则对x/y进行取整,获得整数z,将z条结构化查询语句分配到剩余线程中的一个;循环执行该分配规则,直到所有的线程分配结束。
优选地,所述数据库连接分配模块设置为当剩余用于查询功能的数据库连接为m个,剩余用户查询并发度为n时,则对m/n进行取整,获得整数a,所述结构化查询语句有b条,对a和b取最小值c,则为所述数据库多表连接查询的请求分配c个数据库连接,用于数据库的连接查询;或者,
根据数据库服务器、存储设备的性能、当前用户查询并发度和用户查询最大并发度中的一个或多个资源,为所述数据库多表连接查询的请求分配相应的数据库连接,用于数据库的连接查询。
本发明通过为一次数据库查询分配多条数据库连接,使得查询多表可同时进行,充分使用了数据库资源,在满足业务统计的同时大大提升了查询效率。
附图说明
图1为本发明数据库查询方法第一实施例的流程示意图;
图2为本发明数据库查询方法第二实施例的流程示意图;
图3为本发明数据库查询方法第三实施例的流程示意图;
图4为本发明数据库查询装置第一实施例的功能模块示意图;
图5为本发明数据库查询装置第二实施例的功能模块示意图;
图6为本发明数据库查询装置第三实施例的功能模块示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明提供一种数据库查询方法。参照图1,图1为本发明数据库查询方法第一实施例的流程示意图。该实施例中的数据库查询方法包括以下步骤:
步骤S10、接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
实时监测终端发来的数据库多表连接查询的请求,当接收到终端发来数据库多表连接查询的请求后,根据数据库多表连接查询的请求中的字段以及表格信息构造为多条针对单表的结构化查询语句,将所述结构化查询语句存入内存中。
例如,所述接收对数据库多表连接查询的请求,构造为多条针对单表的结构化查询语句可为:
数据库多表连接查询的请求:select A.begintime,A.location,A.a1,A.a2,B.b1,B.b2from A,B where A.begintime=B.begintime and A.lcoation=B.location,构造为两条针对单表的结构化查询语句:select begintime,location,a1,a2from A以及select begintime,location,b1,b2from B,分别对表A和表B进行查询。或者,
所述数据库多表连接查询的请求可包括:终端界面中的A表、a1字段、a2字段,B表、b1字段、b2字段,连接字段begintime、location,根据数据库多表连接查询的请求对应的查询语句规则,分别构造针对A表和B表的结构化查询语句:select begintime,location,a1,a2from A以及select begintime,location,b1,b2from B,分别对表A和表B进行查询。
步骤S11、根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
接收数据库多表连接查询的请求后,根据当前数据库资源,分配相应的数据库连接数,用于数据库的连接查询。所述数据库资源可包括有数据库服务器、存储设备的性能和用户并发度等等。
数据库连接的分配方式可包括:
A、当剩余用于查询功能的数据库连接为m个,剩余用户查询并发度为n时,则对m/n进行取整,获得整数a,所述结构化查询语句有b条,对a和b取最小值c,则为所述数据库多表连接查询的请求分配c个数据库连接,用于数据库的连接查询。
例如第一个查询只查2个表,对应的有2条结构化查询语句;剩余用于查询功能的数据库连接有50条,剩余用户查询并发度为10,则剩余每个查询请求平均能获取50/10=5个数据库连接,取2和5的最小值,因此分配2个数据库连接给此次数据库多表连接查询的请求;第一个查询未结束时发起第二个查询,第二个查询查12张表,对剩余每个查询请求平均能获取的数据库连接数48/9的计算结果取整为5,取12和5的最小值,那么第二个查询就分配5个数据库连接,以此类推。
或者,B、根据数据库服务器、存储设备的性能、当前用户查询并发度和用户查询最大并发度中的一个或多个资源,为所述数据库多表连接查询的请求分配相应的数据库连接,用于数据库的连接查询。
数据库服务器性能越好或存储设备的性能越好,分配到的数据库连接就越多,当前用户查询并发度越接近用户查询最大并发度时,分配到的数据库连接就越少。所述当前用户查询并发度为当前用户查询数据库的数量,所述用户查询最大并发度为数据库可同时接纳用户查询数据库的最大数量。
步骤S12、按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;
由于数据库连接的资源远少于线程资源,而数据库连接数与线程数是一一对应的,所以只要分配了数据库连接数即可;当存在特殊情况使线程数少于数据库连接数时,实际分配的数据库连接数为线程数。所述预设的分配规则可以为:
A、读取内存中的结构化查询语句,当未分配的结构化查询语句为x个,剩余线程为y时,则对x/y进行取整,获得整数z,将z条结构化查询语句分配到剩余线程中的一个;循环执行该步骤,直到所有的线程分配结束。
例如,有结构化查询语句12条,分配5个数据库连接,对应地有5个线程,该5个线程执行结构化查询语句数量对应为3、3、2、2、2。
或者,B、读取内存中的结构化查询语句,所述结构化查询语句有u条,所述线程有v个,对u/v进行取整,获得整数w;先对每个线程分配w条结构化查询语句,再将剩余的结构化查询语句依次分配给不同的线程。
例如,有结构化查询语句12条,分配5个数据库连接,对应地有5个线程,先对每个线程分配2条结构化查询语句,即该5个线程分配到的结构化查询语句数量对应为2、2、2、2、2;,再将剩余的结构化查询语句依次分配给不同的线程,所以最终该5个线程执行结构化查询语句数量对应为3、3、2、2、2。
步骤S13、接收所述线程执行结构化查询语句后返回的结果集;
线程每执行完一个结构化查询语句的结果为结果集,将所述结果集存入缓存中。
步骤S14、从结果集中获取数据,同时拼接所获取到的数据,获得查询结果。
所述结果集实质是一张表格,表格的一行为一个记录,表格的一列为一个字段,所述的字段包括关键字段和除关键字段以外的普通字段;
新建一查询记录表,读取缓存中结果集的一个记录,将所述记录录入查询记录表中,读取下一个记录,并将该记录的关键字段与查询记录表中的关键字段比较,当关键字段不同时,则增加这个记录到查询记录表中;当关键字段相同时,则增加该记录的普通字段到查询记录表中的相应记录中;当所有结果集录入表中后,所述查询记录表为查询结果。
本实施例中,对数据库的多表查询不再依赖单个数据库连接,而是根据数据库资源,灵活分配多条数据库连接,并在不同的线程中使用这些数据库连接进行并发查询,在满足业务统计的同时大大提升了查询效率。
参照图2,图2为本发明数据库查询方法第二实施例的流程示意图。基于第一实施例,该第二实施例中的接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句之后还包括:
步骤S21、根据预设的排序规则对结构化查询语句的关键字段排序。
所述预设的排序规则为当关键字段为***数字时,可按0至9顺序排序,也可逆序排序;当关键字段为中文或英文时,可取中文拼音的首字母或英文的首字母按a至z顺序排序,也可逆序排序。
对结构化查询语句中指定关键字段排序后,将结构化查询语句分配给所述数据库连接对应的线程执行,线程一边执行一边将结果集存入缓存中,数据库查询***从缓存中读取结果集的数据的同时对数据进行拼接。由于结构化查询语句执行后的结果集是按照关键字段排序的,这样有利于提升拼接效率。
本实施例中,对关键字段进行排序后进行查询,可一边接收线程返回的结果一边对所述结果拼接,大大降低了内存耗用并提升处理效率。
参照图3,图3为本发明数据库查询方法第三实施例的流程示意图。该实施例中的数据库查询方法可包括以下步骤:
步骤S30、接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
实时监测终端发来的数据库多表连接查询的请求,当接收到终端发来数据库多表连接查询的请求后,根据数据库多表连接查询的请求中的字段以及表格信息构造为多条针对单表的结构化查询语句。
所述构造针对单表的结构化查询语已在第一实施例的步骤S10中详细说明,在此不再赘述。
步骤S31、根据预设的分段规则对结构化查询语句的关键字段的范围进行分段;
所述预设的分段规则设置为当关键字段为***数字时,可取数值的最大值和最小值,将其划分为十个范围,同属于一个范围的即为同一分段;类似的,关键字段为中文或英文时,可取中文拼音的首字母和英文的首字母进行分段;当关键字段为时间时,还可按年、月、日、时、分等的方式分段。
步骤S32、按分段的结果对所述结构化查询语句进行处理,生成每个分段所对应的结构化查询语句;
若按照预设的分段规则将关键字段划分为十个范围,则将一条原结构化查询语句进行拆分、重组等处理后,生成十条结构化查询语句,且每一条结构化查询语句负责一个范围。将所述结构化查询语句存入内存中。
步骤S33、根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
接收数据库多表连接查询的请求后,根据当前数据库资源,分配相应的数据库连接数,用于数据库的连接查询。所述数据库资源可包括有数据库服务器、存储设备的性能和用户并发度等等。
所述数据库连接的分配方式已在第一实施例的步骤S11中详细说明,在此不再赘述。
步骤S34、按照分段顺序,将所述每个分段所对应的结构化查询语句按预设的分配规则分配给所述数据库连接对应的线程执行,且属于同一分段的结构化查询语句执行结束后,再执行下一分段的结构化查询语句;
读取内存中的同一分段的结构化查询语句,所述预设的分配规则已在第一实施例的步骤S12中详细说明,在此不再赘述。
步骤S35、接收所述线程执行结构化查询语句后返回的结果集;
线程每执行完一个结构化查询语句的结果为结果集,将所述结果集存入缓存中。
步骤S36、从结果集中获取数据,同时拼接所获取的数据,获得查询结果。
读取缓存中结果集的数据,将同一分段的结构化查询语句的结果集拼接成一个表,即为一个查询结果。完成一个查询结果后,即将该查询结果返回终端。
本实施例中,对数据库的多表查询不再依赖单个数据库连接,而是根据数据库资源,灵活分配多条数据库连接,使用这些数据库连接在不同的线程中并发执行结构化查询语句,在满足业务统计的同时大大提升了查询效率,同时还对关键字段按范围拆分为多次查询计划,可以达到最终结果分批返回的效果,提升首页呈现速度,优化用户体验。
对应地,本发明进一步提供一种数据库查询装置。参照图4,图4为本发明数据库查询装置第一实施例的功能模块示意图。该实施例中的数据库查询装置10包括:
构造模块11,设置为接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
实时监测终端发来的数据库多表连接查询的请求,当接收到终端发来数据库多表连接查询的请求后,根据数据库多表连接查询的请求中的字段以及表格信息构造为多条针对单表的结构化查询语句,将所述结构化查询语句存入内存中。
例如,所述接收对数据库多表连接查询的请求,构造为多条针对单表的结构化查询语句可为:
数据库多表连接查询的请求:select A.begintime,A.location,A.a1,A.a2,B.b1,B.b2from A,B where A.begintime=B.begintime and A.lcoation=B.location,构造为两条针对单表的结构化查询语句:select begintime,location,a1,a2from A以及select begintime,location,b1,b2from B,分别对表A和表B进行查询。或者,
所述数据库多表连接查询的请求可包括:终端界面中的A表、a1字段、a2字段,B表、b1字段、b2字段,连接字段begintime、location,根据数据库多表连接查询的请求对应的查询语句规则,分别构造针对A表和B表的结构化查询语句:select begintime,location,a1,a2from A以及select begintime,location,b1,b2from B,分别对表A和表B进行查询。
数据库连接分配模块12,设置为根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
接收数据库多表连接查询的请求后,根据当前数据库资源,分配相应的数据库连接数,用于数据库的连接查询。所述数据库资源可包括有数据库服务器、存储设备的性能和用户并发度等等。数据库连接的分配方式可包括:
A、当剩余用于查询功能的数据库连接为m个,剩余用户查询并发度为n时,则对m/n进行取整,获得整数a,所述结构化查询语句有b条,对a和b取最小值c,则为所述数据库多表连接查询的请求分配c个数据库连接,用于数据库的连接查询。
例如第一个查询只查2个表,对应的有2条结构化查询语句;剩余用于查询功能的数据库连接有50条,剩余用户查询并发度为10,则剩余每个查询请求平均能获取50/10=5个数据库连接,取2和5的最小值,因此分配2个数据库连接给此次数据库多表连接查询的请求;第一个查询未结束时发起第二个查询,第二个查询查12张表,对剩余每个查询请求平均能获取的数据库连接数48/9的计算结果取整为5,取12和5的最小值,那么第二个查询就分配5个数据库连接,以此类推。
或者,B、根据数据库服务器、存储设备的性能、当前用户查询并发度和用户查询最大并发度中的一个或多个资源,为所述数据库多表连接查询的请求分配相应的数据库连接,用于数据库的连接查询。
数据库服务器性能越好或存储设备的性能越好,分配到的数据库连接就越多,当前用户查询并发度越接近用户查询最大并发度时,分配到的数据库连接就越少。所述当前用户查询并发度为当前用户查询数据库的数量,所述用户查询最大并发度为数据库可同时接纳用户查询数据库的最大数量。
结构化查询语句分配模块13,设置为按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;
由于数据库连接的资源远少于线程资源,而数据库连接数与线程数是一一对应的,所以只要分配了数据库连接数即可;当存在特殊情况使线程数少于数据库连接数时,实际分配的数据库连接数为线程数。所述预设的分配规则可以为:
A、读取内存中的结构化查询语句,当未分配的结构化查询语句为x个,剩余线程为y时,则对x/y进行取整,获得整数z,将z条结构化查询语句分配到剩余线程中的一个;循环执行该步骤,直到所有的线程分配结束。
例如,有结构化查询语句12条,分配5个数据库连接,对应地有5个线程,该5个线程执行结构化查询语句数量对应为3、3、2、2、2。
或者,B、读取内存中的结构化查询语句,所述结构化查询语句有u条,所述线程有v个,对u/v进行取整,获得整数w;先对每个线程分配w条结构化查询语句,再将剩余的结构化查询语句依次分配给不同的线程。
例如,有结构化查询语句12条,分配5个数据库连接,对应地有5个线程,先对每个线程分配2条结构化查询语句,即该5个线程分配到的结构化查询语句数量对应 为2、2、2、2、2;,再将剩余的结构化查询语句依次分配给不同的线程,所以最终该5个线程执行结构化查询语句数量对应为3、3、2、2、2。
接收模块14,设置为接收所述线程执行结构化查询语句后返回的结果集;
线程每执行完一个结构化查询语句的结果为结果集,将所述结果集存入缓存中。
拼接模块15,设置为从结果集中获取数据,同时拼接所获取的数据,获得查询结果。
所述结果集实质是一张表格,表格的一行为一个记录,表格的一列为一个字段,所述的字段包括关键字段和除关键字段以外的普通字段;
新建一查询记录表,读取缓存中结果集的一个记录,将所述记录录入查询记录表中,读取下一个记录,并将该记录的关键字段与查询记录表中的关键字段比较,当关键字段不同时,则增加这个记录到查询记录表中;当关键字段相同时,则增加该记录的普通字段到查询记录表中的相应记录中;当所有结果集录入表中后,所述查询记录表为查询结果。
本实施例中,对数据库的多表查询不再依赖单个数据库连接,而是根据数据库资源,灵活分配多条数据库连接,在满足业务统计的同时大大提升了查询效率。
参照图5,图5为本发明数据库查询装置第二实施例的功能模块示意图。所述基于第一实施例,该第二实施例中的数据库查询装置还包括:
排序模块22,设置为根据预设的排序规则对结构化查询语句的关键字段排序。
所述预设的排序规则为当关键字段为***数字时,可按0至9顺序排序,也可逆序排序;当关键字段为中文或英文时,可取中文拼音的首字母或英文的首字母按a至z顺序排序,也可逆序排序。
对结构化查询语句中指定关键字段排序后,将结构化查询语句分配给所述数据库连接对应的线程执行,线程一边执行一边将结果集存入缓存中,数据库查询***从缓存中读取结果集的数据的同时对数据进行拼接。由于结构化查询语句执行后的结果集是按照关键字段排序的,这样有利于提升拼接效率。
本实施例中,对关键字段进行排序后进行查询,可一边接收线程返回的结果一边对所述结果拼接,大大降低了内存耗用并提升处理效率。
参照图6,图6为本发明数据库查询装置第三实施例的功能模块示意图。
所述基于第一实施例,该第三实施例中的数据库查询装置还包括:
分段模块32,设置为根据预设的分段规则对结构化查询语句的关键字段的范围进行分段和按分段的结果对所述结构化查询语句进行处理,生成每个分段所对应的结构化查询语句;
所述预设的分段规则设置为当关键字段为***数字时,可取数值的最大值和最小值,将其划分为十个范围,同属于一个范围的即为同一分段;类似的,关键字段为中文或英文时,可取中文拼音的首字母和英文的首字母进行分段;当关键字段为时间时,还可按年、月、日、时、分等的方式分段。
若按照预设的分段规则将关键字段划分为十个范围,则将一条原结构化查询语句进行拆分、重组等处理后,生成十条结构化查询语句,且每一条结构化查询语句负责一个范围。将所述结构化查询语句存入内存中。
所述结构化查询语句分配模块34还设置为按照分段顺序,将所述每个分段所对应的结构化查询语句按预设的分配规则分配给所述数据库连接对应的线程执行,且属于同一分段的结构化查询语句执行结束后,再执行下一分段的结构化查询语句。
读取内存中的同一分段的结构化查询语句,所述结构化查询语句分配模块中预设的分配规则已在第一实施例的结构化查询语句分配模块13中详细说明,在此不再赘述。
本实施例中,对数据库的多表查询不再依赖单个数据库连接,而是根据数据库资源,灵活分配多条数据库连接,使用这些数据库连接在不同的线程中并发执行结构化查询语句,在满足业务统计的同时大大提升了查询效率,同时还对关键字段按范围拆分为多次查询计划,可以达到最终结果分批返回的效果,提升首页呈现速度,优化用户体验。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
工业实用性
如上所述,本发明实施例提供的一种数据库查询方法及装置具有以下有益效果:通过为一次数据库查询分配多条数据库连接,使得查询多表可同时进行,充分使用了数据库资源,在满足业务统计的同时大大提升了查询效率。

Claims (10)

  1. 一种数据库查询方法,所述数据库查询方法包括以下步骤:
    接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
    根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
    按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;
    接收所述线程执行结构化查询语句后返回的结果集;
    从结果集中获取数据,同时拼接所获取的数据,获得查询结果。
  2. 如权利要求1所述的数据库查询方法,其中,所述接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句之后还包括:
    根据预设的排序规则对结构化查询语句的关键字段排序。
  3. 如权利要求1所述的数据库查询方法,其中,所述接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句之后还包括:
    根据预设的分段规则对结构化查询语句的关键字段的范围进行分段;
    按分段的结果对所述结构化查询语句进行处理,生成每个分段所对应的结构化查询语句;
    按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行的步骤包括:
    按照分段顺序,将所述每个分段所对应的结构化查询语句按预设的分配规则分配给所述数据库连接对应的线程执行,且属于同一分段的结构化查询语句执行结束后,再执行下一分段的结构化查询语句。
  4. 如权利要求1所述的数据库查询方法,其中,所述预设的分配规则包括:
    当未分配的结构化查询语句为x个,剩余线程为y时,则对x/y进行取整,获得整数z,将z条结构化查询语句分配到剩余线程中的一个;循环执行该步骤,直到所有的线程分配结束。
  5. 如权利要求1所述的数据库查询方法,其中,所述根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询的步骤包括:
    当剩余用于查询功能的数据库连接为m个,剩余用户查询并发度为n时,则对m/n进行取整,获得整数a,所述结构化查询语句有b条,对a和b取最小值c,则为所述数据库多表连接查询的请求分配c个数据库连接,用于数据库的连接查询;或者,
    根据数据库服务器、存储设备的性能、当前用户查询并发度和用户查询最大并发度中的一个或多个资源,为所述数据库多表连接查询的请求分配相应的数据库连接,用于数据库的连接查询。
  6. 一种数据库查询装置,所述数据库查询装置包括:
    构造模块,设置为接收对数据库多表连接查询的请求,根据请求构造多条针对单表的结构化查询语句;
    数据库连接分配模块,设置为根据当前数据库资源,分配相应的数据库连接,用于数据库的连接查询;
    结构化查询语句分配模块,设置为按预设的分配规则,将所述结构化查询语句分配给所述数据库连接对应的线程执行;
    接收模块,设置为接收所述线程执行结构化查询语句后返回的结果集;
    拼接模块,设置为从结果集中获取数据,同时拼接所获取的数据,获得查询结果。
  7. 如权利要求6所述的数据库查询装置,其中,所述数据库查询装置还包括:
    排序模块,设置为根据预设的排序规则对结构化查询语句的关键字段排序。
  8. 如权利要求6所述的数据库查询装置,其中,所述数据库查询装置还包括:
    分段模块,设置为根据预设的分段规则对结构化查询语句的关键字段的范围进行分段和按分段的结果对所述结构化查询语句进行处理,生成每个分段所对应的结构化查询语句;
    所述结构化查询语句分配模块还设置为按照分段顺序,将所述每个分段所对应的结构化查询语句按预设的分配规则分配给所述数据库连接对应的线程执行,且属于同一分段的结构化查询语句执行结束后,再执行下一分段的结构化查询语句。
  9. 如权利要求6所述的数据库查询装置,其中,所述结构化查询语句分配模块中预设的分配规则包括:当未分配的结构化查询语句为x个,剩余线程为y时,则对x/y进行取整,获得整数z,将z条结构化查询语句分配到剩余线程中的一个;循环执行该分配规则,直到所有的线程分配结束。
  10. 如权利要求6所述的数据库查询装置,其中,所述数据库连接分配模块设置为当剩余用于查询功能的数据库连接为m个,剩余用户查询并发度为n时,则对m/n进行取整,获得整数a,所述结构化查询语句有b条,对a和b取最小值c,则为所述数据库多表连接查询的请求分配c个数据库连接,用于数据库的连接查询;或者,
    根据数据库服务器、存储设备的性能、当前用户查询并发度和用户查询最大并发度中的一个或多个资源,为所述数据库多表连接查询的请求分配相应的数据库连接,用于数据库的连接查询。
PCT/CN2014/094259 2014-11-06 2014-12-18 数据库查询方法及装置 WO2015184762A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410621118.6A CN105574052A (zh) 2014-11-06 2014-11-06 数据库查询方法及装置
CN201410621118.6 2014-11-06

Publications (1)

Publication Number Publication Date
WO2015184762A1 true WO2015184762A1 (zh) 2015-12-10

Family

ID=54766022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/094259 WO2015184762A1 (zh) 2014-11-06 2014-12-18 数据库查询方法及装置

Country Status (2)

Country Link
CN (1) CN105574052A (zh)
WO (1) WO2015184762A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018058671A1 (zh) * 2016-09-30 2018-04-05 华为技术有限公司 执行多表连接操作的控制方法及对应装置
CN111459968A (zh) * 2020-03-27 2020-07-28 深圳市金蝶天燕云计算股份有限公司 数据查询方法、数据查询***及计算机存储介质
CN116126865A (zh) * 2023-02-17 2023-05-16 安芯网盾(北京)科技有限公司 一种多种数据库混合使用的代理方法及装置

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106599310A (zh) * 2016-12-29 2017-04-26 中国建设银行股份有限公司 基于多数据源场景的并发查询方法和装置
CN106649828B (zh) * 2016-12-29 2019-12-24 ***股份有限公司 一种数据查询方法及***
CN108280082A (zh) * 2017-01-06 2018-07-13 北京京东尚科信息技术有限公司 一种统计数据的即席查询方法及***
CN106951531B (zh) * 2017-03-21 2020-07-10 东软集团股份有限公司 数据查询方法及装置
CN107273525A (zh) * 2017-06-23 2017-10-20 上海携程商务有限公司 函数式查询方法及***
CN107918676B (zh) * 2017-12-15 2022-01-18 联想(北京)有限公司 结构化查询的资源优化方法及数据库查询***
CN109656946B (zh) * 2018-09-29 2022-12-16 创新先进技术有限公司 一种多表关联查询方法、装置及设备
CN109508344B (zh) * 2018-09-29 2024-03-12 中国平安人寿保险股份有限公司 业务数据查询方法、装置、电子设备及存储介质
CN109271409B (zh) * 2018-11-08 2021-11-02 成都索贝数码科技股份有限公司 一种基于容器资源分配的数据库分片执行方法
CN112131253A (zh) * 2019-06-25 2020-12-25 北京沃东天骏信息技术有限公司 数据查询方法、装置、设备和存储介质
CN110825953B (zh) * 2019-11-12 2024-03-22 上海德启信息科技有限公司 数据查询方法、装置和设备
CN111914151A (zh) * 2020-08-11 2020-11-10 上海毅博电子商务有限责任公司 一种关联表对象查询优化方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1492361A (zh) * 2002-10-25 2004-04-28 联想(北京)有限公司 嵌入式数据库查询的处理方法
CN1556482A (zh) * 2003-12-31 2004-12-22 中兴通讯股份有限公司 一种用于实现数据库多表查询的数据处理方法
US20060136380A1 (en) * 2004-12-17 2006-06-22 Purcell Terence P System and method for executing a multi-table query
CN104112008A (zh) * 2014-07-16 2014-10-22 深圳市国泰安信息技术有限公司 一种多表数据关联查询优化方法和装置
CN104123374A (zh) * 2014-07-28 2014-10-29 北京京东尚科信息技术有限公司 分布式数据库中聚合查询的方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521406B (zh) * 2011-12-26 2014-06-25 中国科学院计算技术研究所 海量结构化数据复杂查询任务的分布式查询方法和***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1492361A (zh) * 2002-10-25 2004-04-28 联想(北京)有限公司 嵌入式数据库查询的处理方法
CN1556482A (zh) * 2003-12-31 2004-12-22 中兴通讯股份有限公司 一种用于实现数据库多表查询的数据处理方法
US20060136380A1 (en) * 2004-12-17 2006-06-22 Purcell Terence P System and method for executing a multi-table query
CN104112008A (zh) * 2014-07-16 2014-10-22 深圳市国泰安信息技术有限公司 一种多表数据关联查询优化方法和装置
CN104123374A (zh) * 2014-07-28 2014-10-29 北京京东尚科信息技术有限公司 分布式数据库中聚合查询的方法及装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018058671A1 (zh) * 2016-09-30 2018-04-05 华为技术有限公司 执行多表连接操作的控制方法及对应装置
CN109791543A (zh) * 2016-09-30 2019-05-21 华为技术有限公司 执行多表连接操作的控制方法及对应装置
CN109791543B (zh) * 2016-09-30 2021-02-12 华为技术有限公司 执行多表连接操作的控制方法及对应装置
US11301470B2 (en) 2016-09-30 2022-04-12 Huawei Technologies Co., Ltd. Control method for performing multi-table join operation and corresponding apparatus
CN111459968A (zh) * 2020-03-27 2020-07-28 深圳市金蝶天燕云计算股份有限公司 数据查询方法、数据查询***及计算机存储介质
CN116126865A (zh) * 2023-02-17 2023-05-16 安芯网盾(北京)科技有限公司 一种多种数据库混合使用的代理方法及装置
CN116126865B (zh) * 2023-02-17 2023-09-08 安芯网盾(北京)科技有限公司 一种多种数据库混合使用的代理方法及装置

Also Published As

Publication number Publication date
CN105574052A (zh) 2016-05-11

Similar Documents

Publication Publication Date Title
WO2015184762A1 (zh) 数据库查询方法及装置
DE102016105472B4 (de) Speicherebenenverteilung und parallele Zuordnung auf Blockebene bei Dateisystemen
US9298774B2 (en) Changing the compression level of query plans
US8712972B2 (en) Query optimization with awareness of limited resource usage
US8924373B2 (en) Query plans with parameter markers in place of object identifiers
CN105279276A (zh) 一种数据库索引优化***
US9305076B1 (en) Flattening a cluster hierarchy tree to filter documents
US10579616B2 (en) Data search system, data search method, and program product
US9355147B2 (en) Access plan for a database query
US9959312B2 (en) High performance index creation on sorted data using parallel query plans
US9734176B2 (en) Index merge ordering
CN105989015B (zh) 一种数据库扩容方法和装置以及访问数据库的方法和装置
Wang et al. Distributed storage and index of vector spatial data based on HBase
CN105683941A (zh) 调节企业数据仓库资源使用
KR102465391B1 (ko) 실시간으로 데이터의 증가 속도에 따라 데이터 처리 주기를 설정하는 시스템의 분석 방법
CN111046059B (zh) 基于分布式数据库集群的低效sql语句分析方法及***
KR20210060830A (ko) 빅데이터 지능형 수집 방법 및 장치
WO2021004266A1 (zh) 数据***方法、装置、设备和储存介质
US11520763B2 (en) Automated optimization for in-memory data structures of column store databases
CN111522819A (zh) 一种树型结构数据汇总的方法及***
TWI785724B (zh) 資訊倉庫創建方法、電子設備及儲存介質
CN113032368A (zh) 一种数据迁移方法、装置、存储介质及平台
US20150081735A1 (en) System and method for fast identification of variable roles during initial data exploration
US11301448B2 (en) Method and system of a secondary index in a distributed data base system
Lai et al. Evaluating data storage structures of MapReduce

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14893906

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14893906

Country of ref document: EP

Kind code of ref document: A1