Method and device for determining database table

By obtaining statistical information of database tables and determining the target database table, the problem of lack of effective judgment criteria for host database table updates is solved, automatic update and SQL optimization are realized, and system resources are saved.

CN114547041BActive Publication Date: 2025-05-09INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210181880.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2025-05-09
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

In the prior art, the host database table is updated based on statistical information, and the lack of effective judgment criteria, resulting in a decrease in the execution efficiency of SQL statements and the host consumes a large amount of system resources.

Method used

By obtaining statistical information of database tables from the data dictionary, including the number of records, actual data volume, table name and index name, multiple target database tables are determined based on this information, and the database tables are updated based on these target database tables.

Benefits of technology

Automatically update database tables is realized, SQL execution efficiency is optimized, system resources are saved, and SQL operation efficiency is avoided due to untimely or inaccurate collection of statistical information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114547041B_ABST
    Figure CN114547041B_ABST
Patent Text Reader

Abstract

The present application discloses a method for determining a database table. The method relates to the field of financial technology, and includes: obtaining statistical information of a database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; determining multiple target database tables based on the statistical information; and updating the database table based on the multiple target database tables. Through the present application, the problem of reduced SQL statement execution efficiency and large host consumption of system resources caused by the lack of effective judgment criteria for updating the host database table based on statistical information in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and specifically, to a method for determining a database table. Background Art

[0002] The host database table statistics play a vital role in the execution efficiency of structured query language (SQL) and directly affect the resource consumption of the host. The host database table statistics are a set of data stored in the data dictionary, which describes the detailed information of the objects in the database from multiple dimensions. Based on these statistics, various possible SQL execution plans are calculated, and the optimizer can select the best execution plan for each SQL. But first of all, it is necessary to ensure that all table statistics in the SQL statement are accurate. If the statistics are inaccurate, then SQL optimization is out of the question. The accuracy of database table statistics directly affects the execution efficiency of SQL statements. It is crucial to collect and manage the host database table statistics in a timely and effective manner. However, for tables with small update volume or extremely large data volume, collecting statistics may not play an effective role in SQL execution efficiency, but will consume a lot of host resources. Therefore, the management and collection of host database table statistics lack an effective and unified judgment standard, and when collecting statistics for tables and indexes, manual judgment and execution are required, lacking automation means.

[0003] Currently, no effective solution has been proposed to solve the problem in the related art that the SQL statement execution efficiency is reduced and the host consumes a large amount of system resources due to the lack of effective judgment criteria when updating the host database table based on statistical information. Summary of the invention

[0004] The main purpose of the present application is to provide a method and device for determining a database table, so as to solve the problem in the related art that the efficiency of SQL statement execution decreases and the host consumes a large amount of system resources due to the lack of effective judgment criteria when updating the host database table based on statistical information.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for determining a database table is provided. The method comprises: obtaining statistical information of a database table from a data dictionary, wherein the statistical information comprises: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; determining multiple target database tables according to the statistical information; and updating the database table according to the multiple target database tables.

[0006] Optionally, determining the multiple target database tables based on the statistical information includes: determining the multiple target database tables based on the number of records and the actual data volume.

[0007] Optionally, multiple target database tables are determined based on the number of records and the actual data volume, including: when the actual data volume is greater than a first preset value and less than a second preset value and the number of records is zero, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than a third preset value and the actual data volume is greater than a first preset multiple of the number of records, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than the third preset value and the number of records is greater than the second preset multiple of the actual data volume and less than the first preset multiple, determining that the database table is the target database table.

[0008] Optionally, updating the database table according to the multiple target database tables includes: determining the number of partitions and the capacity of each target database table among the multiple target database tables; and updating the database table according to the number of partitions and the capacity.

[0009] Optionally, the database table is updated according to the number of partitions and the capacity, including: when the number of partitions is less than a fourth preset value and the capacity is less than a fifth preset value, the corresponding target database table is updated using a full table update method; when the number of partitions is less than a fourth preset value and the capacity is greater than a fifth preset value, the corresponding target database table is updated using a partition update method; when the number of partitions is greater than the fourth preset value, all database tables are updated using an update digital dictionary method.

[0010] Optionally, before determining a plurality of target database tables according to the statistical information, the method further comprises: aggregating the statistical information into a newly created database table, where the newly created database table is used to store the statistical information.

[0011] Optionally, after updating the database table according to the multiple target database tables, the method further comprises: re-aggregating the updated statistical information into the newly created database table.

[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for determining a database table is provided. The device comprises: an acquisition module, used to obtain statistical information of a database table from a data dictionary, wherein the statistical information comprises: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; a determination module, used to determine multiple target database tables according to the statistical information; and an update module, used to update the database table according to the multiple target database tables.

[0013] According to yet another aspect of the embodiments of the present application, a processor is provided, and the processor is used to run a program, wherein the above-mentioned method for determining the database table is executed when the program is running.

[0014] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the above-mentioned method for determining the database table.

[0015] Through this application, the following steps are adopted: obtaining statistical information of a database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; determining multiple target database tables based on the statistical information; updating the database table based on the multiple target database tables, thereby solving the problem in the related art that the SQL statement execution efficiency is reduced and the host consumes a large amount of system resources due to the lack of effective judgment criteria for updating the host database table based on statistical information. Thus, the effect of automatically updating the database table, optimizing the SQL execution efficiency, and saving system resources is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for determining a database table according to an embodiment of the present application;

[0018] Figure 2 is a flowchart of a method for determining a database table according to an embodiment of the present application;

[0019] Figure 3 is a schematic diagram of an optional method for determining a database table according to an embodiment of the present application;

[0020] Figure 4 is a structural block diagram of a device for determining a database table according to an embodiment of the present application;

[0021] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0026] Structured Query Language (SQL) is a special-purpose programming language, a database query and programming language used to store data and query, update, and manage relational database systems.

[0027] A database is a warehouse for storing data, and a database table is a file that stores specific types of data. Database table statistics are information that describes the size, scale, and data distribution of tables and indexes in a database.

[0028] Data dictionary refers to the definition and description of data items, data structures, data storage, processing logic, etc. Its purpose is to provide detailed descriptions of each element in the data flow diagram. In short, the data dictionary is a collection of information that describes data, a collection of definitions of all data elements used in the system, and a directory that records database and application metadata that users can access.

[0029] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0030] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for determining a database table. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0031] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0032] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method for determining the database table in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for determining the database table described above is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0033] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0034] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0035] The present invention is described below in conjunction with preferred implementation steps. Figure 2 is a flowchart of a method for determining a database table according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0036] Step S202, obtaining statistical information of the database table from the data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name;

[0037] The host database table statistics are a set of data stored in the data dictionary, including: the number of records in the database table, the database table name, the index name, the actual data volume, the number of rows in the table, the row length, the number of duplicate column values, the distribution of data on the column, and the number of index pages.

[0038] Step S204, determining multiple target database tables according to the statistical information;

[0039] Step S206: updating the database table according to the multiple target database tables.

[0040] Through the above steps, by providing a unified and effective judgment standard for table statistical information management, the table list that needs to collect statistical information is screened out, and the automatic collection of statistical information such as tables and indexes is realized, which is convenient for optimizing the execution efficiency of SQL and saving system resources at the same time. By realizing the automatic update of the statistical information of the host database table and ensuring the accuracy of the statistical information, it can avoid the deterioration of SQL operation efficiency caused by the untimely collection of statistical information and inaccurate table information, which affects the application and provides an important basis for SQL optimization.

[0041] Optionally, in the method for determining a database table provided in an embodiment of the present application, executing step S204 to determine multiple target database tables based on statistical information includes: determining multiple target database tables based on the number of records and the actual data volume.

[0042] Optionally, in the method for determining a database table provided in an embodiment of the present application, multiple target database tables are determined based on the number of records and the actual data volume, including: when the actual data volume is greater than a first preset value and less than a second preset value and the number of records is zero, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than a third preset value and the actual data volume is greater than a first preset multiple of the number of records, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than the third preset value and the number of records is greater than the second preset multiple of the actual data volume and less than the first preset multiple, determining that the database table is the target database table.

[0043] The acquired information is judged by the established unified standard indicators to select the list that needs to be processed. Optionally, the first preset value can be 500, the second preset value can be 10,000, the third preset value can be 100 million, the first preset multiple can be 5 times, and the second preset multiple can be 20%. If the actual data volume is greater than 500 and less than 10,000, but the number of records in the statistical information is 0, no collection is performed; if the actual data volume is greater than 10,000 and less than 100 million, and the data volume is greater than 5 times the number of records in the statistical information, no collection is performed. When the sum of the table data insertion, deletion and update volume, that is, the number of records exceeds 20% of the actual data volume of the table and the actual number is greater than 10,000, collection is performed.

[0044] In this step, a unified and effective judgment standard for statistical information such as tables and indexes is established. In addition, based on this standard, only the list of tables that need to be collected is screened out, and tables with small update volume or extremely large data volume are not collected, so as to control the consumption of host resources.

[0045] Optionally, in the method for determining a database table provided in an embodiment of the present application, executing step S206 to update the database table according to multiple target database tables includes: determining the number of partitions and capacity of each target database table in the multiple target database tables; and updating the database table according to the number of partitions and capacity.

[0046] Optionally, in the method for determining the database table provided in an embodiment of the present application, the database table is updated according to the number of partitions and the capacity, including: when the number of partitions is less than a fourth preset value and the capacity is less than a fifth preset value, the corresponding target database table is updated using a full table update method; when the number of partitions is less than the fourth preset value and the capacity is greater than the fifth preset value, the corresponding target database table is updated using a partition update method; when the number of partitions is greater than the fourth preset value, all database tables are updated using an update digital dictionary method.

[0047] Optionally, the fourth preset value is 50, the fifth preset value is 30G, and the partition is part. Through the above selection list results, the update method is determined according to the number of parts and the size of the table capacity. Statistical information update methods include full table update, part update, and direct update of the data dictionary. When the number of parts of the table is less than 50 and the table capacity is less than 30G, the full table update method is used; when the number of parts of the table is less than 50 and the table capacity is greater than 30G, the part update method is used; when the number of parts of the table is greater than 50, the direct update of the data dictionary method is used.

[0048] In this step, the update method is determined by the number of parts and the size of the table capacity, which can realize automatic collection and analysis of the table, avoid a large number of repeated manual operations to obtain information, and can be realized without human participation.

[0049] Optionally, in the method for determining a database table provided in an embodiment of the present application, before executing step S204 to determine multiple target database tables based on statistical information, the method further includes: aggregating the statistical information into a newly created database table, and the newly created database table is used to store the statistical information.

[0050] like Figure 3 As shown, before data analysis and processing, the key value information of the statistical information can be summarized into a new database table, and then the basic information of the statistical information can also be summarized into the new database table. By creating a new summary database table, the key value information such as the statistical information update time, the statistical information collection judgment standard indicators, etc. are uniformly updated to the table, and the statistical information is recorded at the same time, including: the number of records in the database table, the database table name, the index name, the actual data volume, the number of rows in the table, the row length, the number of duplicate column values, the distribution of data on the column and the number of index pages, etc., for easy management.

[0051] Optionally, in the method for determining a database table provided in an embodiment of the present application, after executing step S206 to update the database table according to multiple target database tables, the method further includes: re-aggregating the updated statistical information into a newly created database table.

[0052] like Figure 3As shown in the figure, after updating the database table, the result will be fed back. The object statistics after updating the database table will be summarized into the newly created database table for easy tracking. After automatically updating the database table and updating the table statistics to the data dictionary, the updated statistics and standard thresholds will be updated to the newly created table in a timely manner for easy tracking and management.

[0053] The method for determining a database table provided in the embodiment of the present application obtains statistical information of the database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; determines multiple target database tables based on the statistical information; updates the database table based on the multiple target database tables, thereby solving the problem in the related art that the SQL statement execution efficiency is reduced and the host consumes a large amount of system resources due to the lack of effective judgment criteria for updating the host database table based on statistical information. Thus, the effect of automatically updating the database table, optimizing the SQL execution efficiency, and saving system resources is achieved.

[0054] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0055] The embodiment of the present application also provides a device for determining a database table. It should be noted that the device for determining a database table in the embodiment of the present application can be used to execute the method for determining a database table provided in the embodiment of the present application. The following introduces the device for determining a database table provided in the embodiment of the present application.

[0056] Figure 4 is a structural block diagram of a device for determining a database table according to an embodiment of the present application. Figure 4 As shown, the device comprises:

[0057] The acquisition module 40 is used to acquire the statistical information of the database table from the data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name and the database index name of the database table;

[0058] A determination module 42, configured to determine a plurality of target database tables according to the statistical information;

[0059] The updating module 44 is used to update the database table according to multiple target database tables.

[0060] It should be noted that Figure 4 The preferred implementation of the illustrated embodiment can be found in Figure 2 The relevant description of the illustrated embodiment will not be repeated here.

[0061] The database table determination device provided in the embodiment of the present application is used to obtain statistical information of the database table from the data dictionary through the acquisition module 40, wherein the statistical information includes: the number of records in the database table, the actual data volume of the database table, the database table name of the database table, and the database index name; the determination module 42 is used to determine multiple target database tables based on the statistical information; the update module 44 is used to update the database table based on the multiple target database tables, which solves the problem in the related art that the SQL statement execution efficiency is reduced and the host consumes a large amount of system resources due to the lack of effective judgment criteria for updating the host database table based on statistical information, thereby achieving the effect of automatically updating the database table, optimizing the SQL execution efficiency, and saving system resources.

[0062] The database table determination device includes a processor and a memory. The acquisition module 40, the determination module 42, and the update module 44 are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.

[0063] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the automatic update of the database table can be achieved by adjusting the kernel parameters.

[0064] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0065] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for determining the database table is implemented.

[0066] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for determining the database table is executed when the program is running.

[0067] like Figure 5 As shown, an embodiment of the present invention provides an electronic device, the device includes a processor 50, a memory 52 and a program stored in the memory 52 and executable on the processor 50, and the processor 50 implements the following steps when executing the program: obtaining statistical information of a database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; determining multiple target database tables based on the statistical information; and updating the database table based on the multiple target database tables.

[0068] Optionally, determining the multiple target database tables based on the statistical information includes: determining the multiple target database tables based on the number of records and the actual data volume.

[0069] Optionally, multiple target database tables are determined based on the number of records and the actual data volume, including: when the actual data volume is greater than a first preset value and less than a second preset value and the number of records is zero, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than a third preset value and the actual data volume is greater than a first preset multiple of the number of records, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than the third preset value and the number of records is greater than the second preset multiple of the actual data volume and less than the first preset multiple, determining that the database table is the target database table.

[0070] Optionally, updating the database table according to the multiple target database tables includes: determining the number of partitions and the capacity of each target database table among the multiple target database tables; and updating the database table according to the number of partitions and the capacity.

[0071] Optionally, the database table is updated according to the number of partitions and the capacity, including: when the number of partitions is less than a fourth preset value and the capacity is less than a fifth preset value, the corresponding target database table is updated using a full table update method; when the number of partitions is less than a fourth preset value and the capacity is greater than a fifth preset value, the corresponding target database table is updated using a partition update method; when the number of partitions is greater than the fourth preset value, all database tables are updated using an update digital dictionary method.

[0072] Optionally, before determining a plurality of target database tables according to the statistical information, the method further comprises: aggregating the statistical information into a newly created database table, where the newly created database table is used to store the statistical information.

[0073] Optionally, after updating the database table according to the multiple target database tables, the method further comprises: re-aggregating the updated statistical information into the newly created database table.

[0074] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0075] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: obtaining statistical information of a database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name of the database table, and the database index name; determining multiple target database tables based on the statistical information; and updating the database table based on the multiple target database tables.

[0076] Optionally, determining the multiple target database tables based on the statistical information includes: determining the multiple target database tables based on the number of records and the actual data volume.

[0077] Optionally, multiple target database tables are determined based on the number of records and the actual data volume, including: when the actual data volume is greater than a first preset value and less than a second preset value and the number of records is zero, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than a third preset value and the actual data volume is greater than a first preset multiple of the number of records, determining that the database table is not the target database table; when the actual data volume is greater than the second preset value and less than the third preset value and the number of records is greater than the second preset multiple of the actual data volume and less than the first preset multiple, determining that the database table is the target database table.

[0078] Optionally, updating the database table according to the multiple target database tables includes: determining the number of partitions and the capacity of each target database table among the multiple target database tables; and updating the database table according to the number of partitions and the capacity.

[0079] Optionally, the database table is updated according to the number of partitions and the capacity, including: when the number of partitions is less than a fourth preset value and the capacity is less than a fifth preset value, the corresponding target database table is updated using a full table update method; when the number of partitions is less than a fourth preset value and the capacity is greater than a fifth preset value, the corresponding target database table is updated using a partition update method; when the number of partitions is greater than the fourth preset value, all database tables are updated using an update digital dictionary method.

[0080] Optionally, before determining a plurality of target database tables according to the statistical information, the method further comprises: aggregating the statistical information into a newly created database table, where the newly created database table is used to store the statistical information.

[0081] Optionally, after updating the database table according to the multiple target database tables, the method further comprises: re-aggregating the updated statistical information into the newly created database table.

[0082] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0083] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0086] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0087] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0088] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0089] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0090] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0091] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for determining a database table, characterized in that: include: Acquire statistical information of a database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name and the database index name of the database table; Determining multiple target database tables according to the statistical information includes: determining that the database table is not the target database table when the actual data volume is greater than a first preset value and less than a second preset value and the number of records is zero, wherein the second preset value is greater than the first preset value; determining that the database table is not the target database table when the actual data volume is greater than the second preset value and less than a third preset value and the actual data volume is greater than a first preset multiple of the number of records, wherein the third preset value is greater than the second preset value; determining that the database table is the target database table when the actual data volume is greater than the second preset value and less than the third preset value and the number of records is greater than a second preset multiple of the actual data volume and less than the first preset multiple; The database table is updated according to the multiple target database tables.

2. The method according to claim 1, characterized in that Determine multiple target database tables based on the statistical information, including: The multiple target database tables are determined according to the number of records and the actual data volume.

3. The method according to claim 1, characterized in that Updating the database table according to the multiple target database tables includes: Determine the number and capacity of partitions of each target database table in the plurality of target database tables; The database table is updated according to the number of partitions and the capacity.

4. The method according to claim 3, characterized in that Updating the database table according to the number of partitions and the capacity includes: When the number of partitions is less than a fourth preset value and the capacity is less than a fifth preset value, the corresponding target database table is updated using a full table update method, wherein the fourth preset value is used to indicate the number of partitions, and the fifth preset value is used to indicate the capacity of the database table; When the number of partitions is less than the fourth preset value and the capacity is greater than the fifth preset value, updating the corresponding target database table using a partition update method; When the number of partitions is greater than the fourth preset value, all database tables are updated using a digital dictionary update method.

5. The method according to claim 1, characterized in that Before determining a plurality of target database tables according to the statistical information, the method further includes: The statistical information is aggregated into a newly created database table, and the newly created database table is used to store the statistical information.

6. The method according to claim 5, characterized in that After updating the database table according to the multiple target database tables, the method further includes: The updated statistical information is re-aggregated into the newly created database table.

7. A device for determining a database table, characterized in that: include: An acquisition module, used for acquiring statistical information of a database table from a data dictionary, wherein the statistical information includes: the number of records in the database table, the actual amount of data in the database table, the database table name and the database index name of the database table; a determination module, configured to determine a plurality of target database tables according to the statistical information, comprising: determining that the database table is not the target database table when the actual data volume is greater than a first preset value and less than a second preset value and the number of records is zero, wherein the second preset value is greater than the first preset value; determining that the database table is not the target database table when the actual data volume is greater than the second preset value and less than a third preset value and the actual data volume is greater than a first preset multiple of the number of records, wherein the third preset value is greater than the second preset value; determining that the database table is the target database table when the actual data volume is greater than the second preset value and less than the third preset value and the number of records is greater than a second preset multiple of the actual data volume and less than the first preset multiple; An updating module is used to update the database table according to the multiple target database tables.

8. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method for determining a database table according to any one of claims 1 to 6 when running.

9. An electronic device, characterized in that: The invention comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining a database table as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Database management method and device, computing equipment and medium

    CN111949503A