A database instruction execution method, device, apparatus and storage medium

By statistically analyzing data information and determining capacity thresholds in heterogeneous databases, and selecting appropriate heterogeneous devices to execute database commands, the problem of traditional optimization rules being inapplicable in heterogeneous database systems is solved, and the acceleration effect of heterogeneous devices is achieved.

CN116628014BActive Publication Date: 2026-02-27SHANDONG INSPUR SCI RES INST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310613633.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2026-02-27
Estimated Expiration
2043-05-26

AI Technical Summary

Technical Problem

Traditional database optimization rules are no longer applicable to heterogeneous database systems, making it impossible to effectively utilize FPGAs or GPUs for computation.

Method used

By statistically analyzing the data information in the heterogeneous database, data capacity information is obtained, and a data processing capacity threshold is determined based on the preset heterogeneous devices. An execution plan is then generated to determine whether the execution conditions of the heterogeneous devices are met. If they are met, the data is sent to the heterogeneous devices for execution.

Benefits of technology

It improves database optimization by accelerating database operators within a specific data capacity range using heterogeneous devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116628014B_ABST
    Figure CN116628014B_ABST
Patent Text Reader

Abstract

The application discloses a database instruction execution method and device, equipment and storage medium, and relates to the technical field of databases, and comprises the following steps: counting data information in a heterogeneous database to obtain data capacity information of each table in the heterogeneous database, and determining a data processing capacity threshold based on a preset heterogeneous device; obtaining a database operation instruction issued for target data and generating a corresponding execution plan according to the data operation instruction; judging whether the execution plan meets an execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold; if yes, the target data is sent to the preset heterogeneous device, and the execution plan is executed by using the preset heterogeneous device. In this way, whether to use the preset heterogeneous device to execute the execution plan converted from the database operation instruction can be selected according to the actual situation of the data capacity information of the heterogeneous database, and database operator acceleration is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database, in particular to a database instruction execution method, device, equipment and storage medium. BACKGROUND

[0002] Database query optimizers are divided into two categories: Rule-Based Optimizer (RBO) and Cost-Based Optimizer (CBO). Both RBO and CBO contain a series of optimization rules, which can perform equivalent transformation on relational expressions. Common optimization rules include predicate pushdown, column pruning, constant folding, etc. Based on these optimization rules, the relational expression can be transformed equivalently to generate an execution plan. Traditional optimization rules are designed for CPU computing. In a heterogeneous database system, operators may be calculated by FPGA (Field-Programmable Gate Array) or GPU (Graphics Processing Unit). Traditional optimization rules will no longer be applicable. Therefore, it is necessary to design an applicable optimizer for a heterogeneous database. SUMMARY

[0003] Therefore, the purpose of the present application is to provide a database instruction execution method, device, equipment and storage medium, which can select appropriate equipment for execution according to the situation of a heterogeneous database. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a database instruction execution method applied to a heterogeneous database, comprising:

[0005] Statistical information of data in the heterogeneous database is counted to obtain data capacity information of each table in the heterogeneous database, and a data processing capacity threshold is determined based on a preset heterogeneous device;

[0006] A database operation instruction issued for target data is obtained, and a corresponding execution plan is generated according to the data operation instruction;

[0007] Based on the data capacity information and the data processing capacity threshold, it is judged whether the execution plan meets the execution condition of the preset heterogeneous device;

[0008] If yes, the target data is sent to the preset heterogeneous device, and the execution plan is executed by using the preset heterogeneous device.

[0009] Optionally, the preset heterogeneous device is a heterogeneous device composed of a CPU and a FPGA or a GPU.

[0010] Optionally, the determining the data processing capacity threshold based on the preset heterogeneous device comprises:

[0011] acquiring current network bandwidth data, and determining the data processing capacity threshold of the preset heterogeneous device based on the network bandwidth data.

[0012] Optionally, the counting the data information in the heterogeneous database to obtain the data capacity information of each table in the heterogeneous database comprises:

[0013] counting the data information in the heterogeneous database based on an ANALYZE command configured through a preset manual configuration interface to obtain the data capacity information of each table in the heterogeneous database.

[0014] Optionally, the counting the data information in the heterogeneous database to obtain the data capacity information of each table in the heterogeneous database comprises:

[0015] counting the data information in the heterogeneous database based on an automatic collection instruction integrated in advance in the background to obtain the data capacity information of each table in the heterogeneous database.

[0016] Optionally, the judging whether the execution plan meets the execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold comprises:

[0017] judging the data capacity information and the data processing capacity threshold by a rule-based optimizer to determine whether the execution plan meets the execution condition of the preset heterogeneous device.

[0018] Optionally, after the judging whether the execution plan meets the execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold, the method further comprises:

[0019] if the execution condition of the preset heterogeneous device is not met, directly executing the execution plan by a local CPU based on a cost-based optimizer.

[0020] In a second aspect, the application discloses a database instruction execution device applied to a heterogeneous database, comprising:

[0021] an information counting module configured to count data information in the heterogeneous database to obtain data capacity information of each table in the heterogeneous database, and determine a data processing capacity threshold based on a preset heterogeneous device;

[0022] a plan generating module configured to acquire database operation instructions issued for target data and generate corresponding execution plans according to the data operation instructions.

[0023] a condition judging module, configured to judge whether the execution plan meets an execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold;

[0024] a plan execution module, configured to send the target data to the preset heterogeneous device and execute the execution plan by using the preset heterogeneous device if the execution condition is met.

[0025] In a third aspect, the present application discloses an electronic device, comprising:

[0026] a memory, configured to save a computer program;

[0027] a processor, configured to execute the computer program to implement the database instruction execution method.

[0028] In a fourth aspect, the present application discloses a computer readable storage medium, configured to save a computer program, which is executed by a processor to implement the database instruction execution method.

[0029] It can be seen that, in the present application, data information in a heterogeneous database is counted to obtain data capacity information of each table in the heterogeneous database, and a data processing capacity threshold of a preset heterogeneous device is determined based on the preset heterogeneous device; a database operation instruction for target data is obtained and a corresponding execution plan is generated according to the data operation instruction; whether the execution plan meets an execution condition of the preset heterogeneous device is judged based on the data capacity information and the data processing capacity threshold; if the execution condition is met, the target data is sent to the preset heterogeneous device, and the execution plan is executed by using the preset heterogeneous device. In this way, by counting data information in a heterogeneous database to obtain data capacity information of each table, a data processing capacity threshold of a preset heterogeneous device is determined, whether the preset heterogeneous device can be used to execute an execution plan corresponding to an obtained data operation instruction is determined according to data capacity information corresponding to target data and the data processing capacity threshold, and if so, the execution plan is executed by using the preset heterogeneous device. In this way, since the preset heterogeneous device has a certain acceleration effect on database operators within a certain data capacity range, the preset heterogeneous device is used to optimize the heterogeneous database, and the optimization effect can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0030] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only aim at the embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of the provided drawings.

[0031] Figure 1 A flow chart of a database instruction execution method disclosed in the present application is provided.

[0032] Figure 2 A flow chart of a specific database instruction execution method disclosed in the present application is provided.

[0033] Figure 3 A flow chart of a specific database instruction execution method disclosed in the present application is provided.

[0034] Figure 4 A structural schematic diagram of a database instruction execution device disclosed in the present application is provided.

[0035] Figure 5 A structural diagram of an electronic device disclosed in the present application is provided. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the scope of protection of the present application.

[0037] Traditional optimization rules are for CPU computing, and in a heterogeneous database system, operators can be calculated by FPGA or GPU. The traditional optimization rules will no longer be applicable. Therefore, the present application will introduce a database instruction execution method for determining an optimization method according to database capacity information, which can improve the database optimization effect.

[0038] Referring to Figure 1 The embodiments of the present application disclose a database instruction execution method applied to a heterogeneous database, which comprises the following steps.

[0039] Step S11: The data information in the heterogeneous database is counted to obtain the data capacity information of each table in the heterogeneous database, and a data processing capacity threshold is determined based on a preset heterogeneous device.

[0040] In the embodiment, the data information in the heterogeneous database is counted to obtain the data capacity information of each table in the heterogeneous database, which is the data capacity information collected by analyzing the data table in the heterogeneous database in advance. The counting of the data information in the heterogeneous database to obtain the data capacity information of each table in the heterogeneous database comprises counting the data information in the heterogeneous database based on the ANALYZE command configured through the preset manual configuration interface to obtain the data capacity information of each table in the heterogeneous database. Alternatively, the data information in the heterogeneous database is counted based on the automatic collection instruction integrated in the background in advance to obtain the data capacity information of each table in the heterogeneous database. Most databases support manual execution of the ANALYZE command for collection. However, a part of the data can automatically collect the data information in the database. The data processing capacity threshold is determined based on the preset heterogeneous device, which comprises obtaining the current network bandwidth data and determining the data processing capacity threshold of the preset heterogeneous device based on the network bandwidth data. Here, the data processing capacity threshold is set according to the acceleration performance of the preset heterogeneous device. The acceleration performance refers to that, when the preset heterogeneous device implements the acceleration operator, the system interface bandwidth has a certain acceleration effect on the data within a certain capacity range compared with the CPU operation, such as greater than 1 GB and less than 10 GB.

[0041] Step S12: Obtain the database operation instruction issued for the target data and generate a corresponding execution plan according to the data operation instruction.

[0042] In the embodiment, any optimizer can generate an execution plan based on the corresponding equivalent conversion of the relational expression. Therefore, after obtaining the database operation instruction issued for the target data, the operation instruction is converted into a corresponding execution plan.

[0043] Step S13: Determine whether the execution plan meets the execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold.

[0044] In the embodiment, the determination of whether the execution plan meets the execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold comprises judging the data capacity information and the data processing capacity threshold by a rule-based optimizer to determine whether the execution plan meets the execution condition of the preset heterogeneous device. That is, the RBO determines whether the execution plan can be executed by the preset heterogeneous device according to the data capacity information and the data processing capacity threshold.

[0045] Step S14: if yes, the target data is sent to the preset heterogeneous device, and the execution plan is executed by using the preset heterogeneous device.

[0046] In this embodiment, if yes, the target data can be sent to the preset heterogeneous device, and the execution plan can be executed by using the preset heterogeneous device, so that a suitable optimizer can be selected for the heterogeneous database, and the optimization effect is improved. After judging whether the execution plan meets the execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold, the method further includes: if no, the execution plan is directly executed by a local CPU and a cost-based optimizer is selected. If the execution condition is not met, it indicates that the execution plan cannot achieve the acceleration effect by using the preset heterogeneous device, and thus the execution plan can be directly executed by the local CPU and the cost-based optimizer is selected.

[0047] As shown in Figure 2 In this embodiment, data information in the heterogeneous database is counted to obtain data capacity information of each table in the heterogeneous database, and a data processing capacity threshold of a preset heterogeneous device is determined. Database operation instructions for target data are obtained, and an execution plan corresponding to the data operation instructions is generated. Whether the execution plan meets the execution condition of the preset heterogeneous device is judged based on the data capacity information and the data processing capacity threshold. If yes, the target data is sent to the preset heterogeneous device, and the execution plan is executed by using the preset heterogeneous device. In this way, by counting data information in the heterogeneous database to obtain data capacity information of each table, a data processing capacity threshold of a preset heterogeneous device is determined, and whether the execution plan corresponding to the obtained data operation instructions can be executed by using the preset heterogeneous device is determined according to the data capacity information corresponding to the target data and the data processing capacity threshold. If yes, the execution plan is executed by using the preset heterogeneous device. In this way, since the preset heterogeneous device has a certain acceleration effect on database operators within a certain data capacity range, the optimization of the heterogeneous database by using the preset heterogeneous device can improve the optimization effect.

[0048] The above embodiment introduces a database instruction execution method for determining an optimization method according to database capacity information, which can improve the database optimization effect. In this embodiment, the method is specifically refined by a specific heterogeneous device.

[0049] As shown in Figure 3 In this embodiment, a database instruction execution method is disclosed, which is applied to a heterogeneous database and includes the following steps.

[0050] Step S21: statistics is performed on data information in the heterogeneous database to obtain data capacity information of each table in the heterogeneous database, and a data processing capacity threshold is determined based on the CPU+FPGA heterogeneous device.

[0051] In this embodiment, the acceleration performance of the CPU+FPGA heterogeneous device sets the data processing capacity threshold accordingly. The acceleration performance refers to the fact that, when implementing an acceleration operator, the CPU+FPGA heterogeneous device has a certain acceleration effect on data within a certain capacity range compared with CPU operation due to the influence of system interface bandwidth, such as a range greater than 1 GB and less than 10 GB. It should be noted that the heterogeneous device in this embodiment can be a heterogeneous device using CPU and FPGA, or a heterogeneous device using CPU and GPU, and of course it does not exclude the use of a heterogeneous device using CPU, GPU and FPGA.

[0052] Step S22: obtaining a database operation instruction issued for target data and generating a corresponding execution plan according to the data operation instruction.

[0053] Step S23: judging the data capacity information and the data processing capacity threshold by a rule-based optimizer to determine whether the execution plan meets the execution condition of the CPU+FPGA heterogeneous device.

[0054] In this embodiment, the RBO selects whether the CPU+FPGA heterogeneous device can be used to execute the execution plan according to the data capacity information and the data processing capacity threshold. That is, it is determined whether the data capacity of the target data is within the data processing capacity threshold range in which the CPU+FPGA heterogeneous device can be accelerated.

[0055] Step S24: if the condition is met, the target data is sent to the CPU+FPGA heterogeneous device, and the execution plan is executed by using the CPU+FPGA heterogeneous device.

[0056] Step S25: if the execution condition of the CPU+FPGA heterogeneous device is not met, a cost-based optimizer is selected to directly execute the execution plan by using a local CPU.

[0057] In this embodiment, if the execution condition of the CPU+FPGA heterogeneous device is not met, a cost-based optimizer is selected to directly execute the execution plan by using a local CPU. If the execution condition is not met, it means that using the CPU+FPGA heterogeneous device to execute the execution plan cannot achieve acceleration effect at this time, and therefore a cost-based optimizer can be selected to directly execute the execution plan by using a local CPU.

[0058] The specific process of steps S22 and S24 is described above, and will not be repeated here.

[0059] In this embodiment, the data information in the heterogeneous database is first counted to obtain the data capacity information of each table in the heterogeneous database, and the data processing capacity threshold is determined based on the heterogeneous device of CPU+FPGA. The database operation instruction issued for the target data is obtained, and the corresponding execution plan is generated according to the data operation instruction. The data capacity information and the data processing capacity threshold are judged by the rule-based optimizer to determine whether the execution plan meets the execution condition of the heterogeneous device of CPU+FPGA. If yes, the target data is sent to the heterogeneous device of CPU+FPGA, and the execution plan is executed by using the heterogeneous device of CPU+FPGA. If not, the cost-based optimizer is selected to directly execute the execution plan by using the local CPU. In this way, the data processing capacity threshold can be changed in real time according to the actual situation of the network bandwidth, so that the appropriate device can be selected to execute the execution plan in real time, and the optimization effect of the optimizer can be improved.

[0060] Reference Figure 4 According to the above description, the embodiments of the present application also disclose a database instruction execution device applied to a heterogeneous database, comprising:

[0061] The information counting module 11 is configured to count the data information in the heterogeneous database to obtain the data capacity information of each table in the heterogeneous database, and determine the data processing capacity threshold based on a preset heterogeneous device.

[0062] The plan generation module 12 is configured to obtain the database operation instruction issued for the target data and generate the corresponding execution plan according to the data operation instruction.

[0063] The condition judgment module 13 is configured to judge whether the execution plan meets the execution condition of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold.

[0064] The plan execution module 14 is configured to send the target data to the preset heterogeneous device and execute the execution plan by using the preset heterogeneous device if the execution plan meets the execution condition.

[0065] It can be seen that in the embodiment, the data information in the heterogeneous database is counted to obtain the data capacity information of each table in the heterogeneous database, and the data processing capacity threshold of the preset heterogeneous device is determined based on the preset heterogeneous device; the database operation instruction issued for the target data is obtained, and the corresponding execution plan is generated according to the data operation instruction; whether the execution plan meets the execution condition of the preset heterogeneous device is judged based on the data capacity information and the data processing capacity threshold; if yes, the target data is sent to the preset heterogeneous device, and the execution plan is executed by using the preset heterogeneous device. In this way, by counting the data information in the heterogeneous database to obtain the data capacity information of each table, the data processing capacity threshold of the preset heterogeneous device is determined, and whether the execution plan corresponding to the obtained data operation instruction can be executed by using the preset heterogeneous device is determined according to the data capacity information corresponding to the target data and the data processing capacity threshold. If yes, the execution plan is executed by using the preset heterogeneous device. In this way, since the preset heterogeneous device has a certain acceleration effect on the database operator within a certain data capacity range, the optimization effect can be improved by using the preset heterogeneous device to optimize the heterogeneous database.

[0066] In some specific embodiments, the information counting module 11 can specifically include:

[0067] The threshold determination unit is configured to obtain current network bandwidth data, and determine the data processing capacity threshold of the preset heterogeneous device based on the network bandwidth data.

[0068] In some specific embodiments, the information counting module 11 can specifically include:

[0069] The first information counting unit is configured to count the data information in the heterogeneous database based on the ANALYZE command configured through the preset manual configuration interface, so as to obtain the data capacity information of each table in the heterogeneous database.

[0070] In some specific embodiments, the information counting module 11 can specifically include:

[0071] The second information counting unit is configured to count the data information in the heterogeneous database based on the automatic collection instruction integrated in the background in advance, so as to obtain the data capacity information of each table in the heterogeneous database.

[0072] In some specific embodiments, the condition judging module 13 can specifically include:

[0073] A threshold judging unit is configured to judge the data capacity information and the data processing capacity threshold by a rule-based optimizer to determine whether the execution plan meets the execution condition of the preset heterogeneous device.

[0074] In some specific embodiments, the database instruction execution apparatus can further include:

[0075] A CPU execution module is configured to, if the execution condition of the preset heterogeneous device is not met, directly execute the execution plan by a local CPU through a cost-based optimizer.

[0076] Further, the embodiment of the present application further discloses an electronic device, Figure 5 is an electronic device 20 structure diagram according to an exemplary embodiment, the contents in the figure cannot be considered as any limitation on the use range of the present application.

[0077] Figure 5 An electronic device 20 structure diagram is provided for the embodiment of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the related steps in the database instruction execution method disclosed in any of the preceding embodiments. In addition, the electronic device 20 in the embodiment can be an electronic computer.

[0078] In the embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and the specific interface type can be selected according to the specific application needs, which is not limited here.

[0079] In addition, the memory 22 as a resource storage carrier can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.

[0080] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 can further include computer programs capable of performing other specific work in addition to the computer program capable of performing the database instruction execution method performed by the electronic device 20 disclosed in any of the preceding embodiments.

[0081] Further, the present application also discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the database instruction execution method disclosed above. For the specific steps of the method, please refer to the corresponding content disclosed in the preceding embodiments, which will not be repeated here.

[0082] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be mutually referred to. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.

[0083] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0084] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0085] Finally, it needs to be pointed out that in this document, relational terms such as first and second and the like can only be intended to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprising", "including", or any other variant 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 can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus including the stated element.

[0086] The above detailed description of the technical solutions provided by the present application has been provided, and the principles and implementation modes of the present application have been described by applying specific examples. The above description of the examples is only for the purpose of helping to understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the content of the specification should not be understood as a limitation of the present application.

Claims

1. A method of database instruction execution, characterized by, The application is applied to a heterogeneous database, and comprises: statistic data information in the heterogeneous database to obtain data capacity information of each table in the heterogeneous database, and determine a data processing capacity threshold based on a preset heterogeneous device; the data processing capacity threshold is set based on acceleration performance of the heterogeneous device; the data processing capacity threshold is determined based on the network bandwidth data of the preset heterogeneous device; obtain database operation instructions issued for target data and generate a corresponding execution plan according to the data operation instructions; determine whether the execution plan meets execution conditions of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold; the determination whether the execution plan meets the execution conditions of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold comprises: judging the data capacity information and the data processing capacity threshold by a rule-based optimizer to determine whether the execution plan meets the execution conditions of the preset heterogeneous device; if yes, send the target data to the preset heterogeneous device and execute the execution plan by using the preset heterogeneous device.

2. The database instruction execution method of claim 1, wherein, The preset heterogeneous device is a heterogeneous device composed of a CPU and an FPGA or a GPU.

3. The database instruction execution method of claim 1, wherein, The statistic data information in the heterogeneous database to obtain the data capacity information of each table in the heterogeneous database comprises: statistic data information in the heterogeneous database based on an ANALYZE command configured by a preset manual configuration interface to obtain the data capacity information of each table in the heterogeneous database.

4. The database instruction execution method of claim 1, wherein, The statistic data information in the heterogeneous database to obtain the data capacity information of each table in the heterogeneous database comprises: statistic data information in the heterogeneous database based on an automatic collection instruction integrated in advance in the background to obtain the data capacity information of each table in the heterogeneous database.

5. The database instruction execution method according to any one of claims 1 to 4, characterized by, After the determination whether the execution plan meets the execution conditions of the preset heterogeneous device based on the data capacity information and the data processing capacity threshold, the method further comprises: if no, execute the execution plan directly by a local CPU by selecting a cost-based optimizer.

6. A database instruction execution apparatus characterized by comprising: The application is applied to a heterogeneous database, and comprises: an information statistic module configured to statistic data information in the heterogeneous database to obtain data capacity information of each table in the heterogeneous database, and determine a data processing capacity threshold based on a preset heterogeneous device; the data processing capacity threshold is set based on acceleration performance of the heterogeneous device; the data processing capacity threshold is determined based on network bandwidth data of the preset heterogeneous device; an execution plan generation module configured to obtain database operation instructions issued for target data and generate a corresponding execution plan according to the data operation instructions; A condition judging module is configured to judge whether the execution plan meets the execution condition of the preset heterogeneous device based on the data volume information and the data processing capacity threshold. The judgment of whether the execution plan meets the execution condition of the preset heterogeneous device based on the data volume information and the data processing capacity threshold comprises: judging the data volume information and the data processing capacity threshold by a rule-based optimizer to determine whether the execution plan meets the execution condition of the preset heterogeneous device. An execution plan executing module is configured to send the target data to the preset heterogeneous device and execute the execution plan by using the preset heterogeneous device if the execution condition is met.

7. An electronic device, comprising: The database instruction execution method comprises: a memory configured to save a computer program; a processor configured to execute the computer program to implement the database instruction execution method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer program is saved and executed by the processor to implement the database instruction execution method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for accelerating GPU operator execution in heterogeneous database system and application

    CN115794874A