A data processing method, related equipment, media, and product

By acquiring database performance and operational information, identifying indexes, and maintaining them within appropriate time windows, the problem of delayed database index maintenance was solved, enabling timely database maintenance and performance optimization.

CN122086862APending Publication Date: 2026-05-26CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610059690.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-05-26

Smart Images

  • Figure CN122086862A_ABST
    Figure CN122086862A_ABST
Patent Text Reader

Abstract

This application provides a data processing method, electronic device, medium, and product; wherein the method includes: acquiring performance information and operational information of a database during business operations; the operational information is used to indicate information associated with the operational status of each data table in the database; determining maintenance information of the database based on the operational information; the maintenance information is used to indicate a first index to be deleted and / or a second index to be added in the database; deleting the first index and / or adding the second index based on the performance information; through this application, timely maintenance of the database can be achieved, while reducing the performance impact of index maintenance on the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, electronic device, medium, and product. Background Technology

[0002] Database indexes are one of the most important data structures in a database. Using indexes properly can improve the overall performance of the database, and index maintenance can help users adjust indexes when they are missing or too numerous.

[0003] In related technologies, databases only perform index maintenance when business operations are disrupted, which fails to address the issue of delayed index maintenance. Summary of the Invention

[0004] This application provides a data processing method, electronic device, medium, and product that can achieve timely database maintenance while reducing the performance impact of index maintenance on the database.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides a data processing method, the method comprising: Obtain performance and operational information of the database during business operations; the operational information is used to indicate information associated with the operational status of each data table in the database; The maintenance information of the database is determined based on the operational information; the maintenance information is used to indicate the first index to be deleted and / or the second index to be added in the database; Based on the performance information, delete the first index and / or add the second index.

[0006] In the above scheme, the operational information includes the execution rate information of the Structured Query Language statements and the index usage frequency information of the indexes corresponding to each data table; determining the maintenance information of the database based on the operational information includes: Obtain the table structure information of each data table; The first index is determined based on the table structure information and the index usage frequency information; The second index is determined based on the table structure information and the execution rate information.

[0007] In the above scheme, determining the first index based on the table structure information and the index usage frequency information includes: A third index is determined from the database based on the index usage frequency information; the index usage frequency of the third index is less than a first threshold. The first index is determined based on the table structure information of the data table corresponding to the third index.

[0008] In the above scheme, determining the second index based on the table structure information and the execution rate information includes: The target structured query language statement is determined from the database based on the execution rate information; the execution rate of the target structured query language statement is less than a second threshold. The second index is determined based on the table structure information of the data table corresponding to the target structured query language statement.

[0009] In the above scheme, deleting the first index based on the performance information includes: The first time window of the first index is matched based on the performance information; The first index is deleted based on the first time window.

[0010] In the above scheme, adding the second index based on the performance information includes: The second time window of the second index is matched based on the performance information; The second index is added based on the second time window.

[0011] The method in the above scheme further includes: Generate an index usage profile for the database based on the operational information and the performance information; Based on the index usage profile, the index usage frequency of the corresponding indexes of each data table in the target time period is predicted to obtain the prediction result; Based on the prediction results, the structure and / or state of the index are adjusted before the target time period.

[0012] This application provides a data processing apparatus, the apparatus comprising: The acquisition unit is used to acquire performance information and operational information of the database during business execution; the operational information is used to indicate information associated with the operational status of each data table in the database. A processing unit is configured to determine maintenance information of the database based on the operational information; the maintenance information is used to indicate a first index to be deleted and / or a second index to be added in the database. The processing unit is configured to delete the first index and / or add the second index based on the performance information.

[0013] This application provides an electronic device, including: a processor and a memory for storing computer programs capable of running on the processor. When the processor runs the computer program, it executes the data processing method provided in the embodiments of this application.

[0014] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the data processing method provided in this application when executed by a processor.

[0015] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the data processing method provided in this application.

[0016] The embodiments of this application have the following beneficial effects: the first index to be deleted and / or the second index to be added in the database are determined by the performance information of the database when performing business; the first index is deleted and / or the second index is added based on the performance information; the problem of lagging index maintenance in related technologies is solved, timely maintenance of the database is realized, and the performance impact of index maintenance on the database is reduced. Attached Figure Description

[0017] Figure 1 A flowchart illustrating a data processing scheme provided in an embodiment of this application; Figure 2 A flowchart illustrating another data processing scheme provided in an embodiment of this application; Figure 3 A schematic diagram illustrating database performance stress as provided in an embodiment of this application; Figure 4 A schematic diagram of an index prediction process provided in an embodiment of this application; Figure 5 A schematic diagram illustrating an index usage pattern provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0020] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0021] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0022] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0023] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0024] Figure 1 This is an optional flowchart illustrating the data processing method provided in the embodiments of this application. The following will be combined with... Figure 1 The steps shown are explained as follows: Figure 1 As shown, the method includes the following steps: Step S101: Obtain performance and operational information of the database during business execution.

[0025] Among them, the running information is used to indicate information associated with the running status of each data table in the database.

[0026] Understandably, database systems can continuously collect various information generated during database operations through monitoring modules. Information associated with the operational status of each data table in the database can include the execution frequency of Structured Query Language (SQL) statements and the index usage frequency of the corresponding indexes for each data table.

[0027] In practical applications, the frequency and method of collecting performance and operational information can be reasonably set according to actual needs to avoid database performance degradation caused by the collection process itself. The collected data can be compressed, filtered, and aggregated to retain key feature values ​​and reduce the amount of data for subsequent analysis.

[0028] Step S102: Determine the database maintenance information based on the running information.

[0029] The maintenance information is used to indicate the first index to be deleted and / or the second index to be added in the database.

[0030] In practical applications, database systems can identify and mark inefficient or unused indexes based on runtime information; they can also identify and mark slow-performing SQL statements. The first index refers to an index that exists in the database but is rarely used, or whose usage frequency is far below expectations. Deleting the first index can free up resources and improve the overall performance of the database. The second index refers to a missing index in the database; for example, the lack of a suitable index can lead to low query efficiency for frequently executed queries.

[0031] refer to Figure 2 As shown, before determining whether an index is to be added or deleted, the system also needs to consider the table structure corresponding to inefficient or unused indexes and the table structure corresponding to slow-executing SQL statements.

[0032] The system can combine table structure information corresponding to inefficient or unused indexes with table structure information corresponding to slow-executed SQL statements for comprehensive analysis, thereby generating accurate maintenance information.

[0033] Step S103: Delete the first index and / or add the second index based on performance information.

[0034] In practical applications, index maintenance operations can have a certain impact on database performance. Therefore, it is advisable to choose an appropriate time window to perform these operations in order to minimize the impact on normal business operations.

[0035] refer to Figure 2 As shown, performance information can include the performance pressure on the instance and the performance pressure on the data tables. The performance pressure on the instance can be understood as the overall pressure on the database. The performance pressure on the data tables can be understood as the frequency of use of the data tables.

[0036] refer to Figure 3As shown, if there is a period of time when both instance pressure and table usage frequency are low, then that period is selected as the maintenance window, and the first index is deleted and / or the second index is added. If the periods of instance pressure and table usage frequency are opposite, then the period of time with relatively low impact on the instance and table (performance crossover point) is selected as the maintenance window.

[0037] As can be seen from the above, this application determines the indexes to be deleted or added by collecting the database's operating information, and maintains them in an appropriate time window based on performance information. This solves the problem of delayed index maintenance in related technologies, realizes timely database maintenance, and reduces the impact of index maintenance on database performance.

[0038] In some embodiments of this application, the runtime information includes the execution rate information of Structured Query Language statements and the index usage frequency information of the indexes corresponding to each data table; the maintenance information of the database is determined based on the runtime information, including: Obtain the table structure information for each data table; The first index is determined based on table structure information and index usage frequency information; The second index is determined based on table structure information and execution rate information.

[0039] In practical applications, table structure information refers to the definition and organization of each data table in a database system, including metadata such as field names, field types, primary keys, foreign keys, and constraints.

[0040] Index usage frequency information refers to the usage of existing indexes in a database system in actual business operations. It can be recorded by statistical tools, including the number of times each index is used and its frequency.

[0041] By combining the table structure information of each data table with the index usage frequency information of the corresponding indexes of each data table, the system can identify the indexes that have been effectively utilized and determine the first index based on the index usage.

[0042] Execution rate information refers to the actual execution performance of Structured Query Language (SCL) statements in a database system, including metrics such as the number of times the statement is executed, execution time, number of rows scanned, and whether indexes are hit. By analyzing the execution rate information of SCL statements, it is possible to identify which SCL statements have low execution efficiency, which may be due to the lack of suitable indexes.

[0043] By combining the table structure information of each data table with the execution rate information of the structured query language statements, it is possible to determine whether there are missing indexes and to determine the second index based on the judgment result.

[0044] By obtaining the table structure information of each data table, and combining it with the index usage frequency information of the corresponding indexes of each data table and the execution rate information of structured query language statements, the usage and optimization space of the indexes can be comprehensively judged, and the effectiveness of the database system indexes can be evaluated more comprehensively.

[0045] In some embodiments of this application, determining the first index based on table structure information and index usage frequency information includes: The third index is determined from the database based on index usage frequency information; the index usage frequency of the third index is less than the first threshold. The first index is determined based on the table structure information of the data table corresponding to the third index.

[0046] In practical applications, the frequency of index usage can be used to determine whether an index has high value to the current business. The first threshold is a preset numerical standard used to determine if an index is in a low-frequency state. When the usage frequency of an index falls below the first threshold, the system determines that the index may no longer be worth maintaining. The first threshold can be dynamically adjusted according to different business scenarios. For example, in a high-concurrency transaction system, the first threshold can be set to more than 100 times per hour, while in a log-type system, it can be set to more than 5 times per day.

[0047] The process of filtering out infrequently used indexes (i.e., third indexes) based on their usage frequency can identify indexes that are inactive in the current business but still consume storage space and maintenance costs. By analyzing the table structure information of the data table associated with the third index, it can be determined whether there are redundant indexes. By analyzing the table structure information to determine the first index to be deleted, the structural advantages of the existing table can be fully utilized, and the index design can be optimized in a targeted manner.

[0048] In some embodiments of this application, the second index is determined based on table structure information and execution rate information, including: The target structured query language statement is determined from the database based on the execution rate information; the execution rate of the target structured query language statement is less than the second threshold. The second index is determined based on the table structure information of the data table corresponding to the target structured query language statement.

[0049] In practical applications, target Structured Query Language (SCL) statements refer to SQL statements with low execution frequency in the database. An execution rate below the second threshold means that the number of times the target SCL statement is executed is lower than the set judgment standard, which can be understood as a potential optimization target. By filtering out target SCL statements, the system can further analyze whether adding indexes can improve their execution efficiency. The second threshold can be dynamically adjusted according to business scenarios and database load. For example, in high-concurrency scenarios, the system sets a higher threshold to avoid frequent index maintenance; in low-load scenarios, the system appropriately lowers the threshold to detect potential problems early.

[0050] By analyzing the structure of the data table operated on by the target structured query language statements, the system can determine which fields are suitable for creating indexes and identify secondary indexes. This can avoid creating unnecessary indexes and reduce additional overhead on database performance.

[0051] In some embodiments of this application, deleting the first index based on performance information includes: The first time window of the first index is matched based on performance information; The first index is deleted based on the first time window.

[0052] In practical applications, performance information refers to various metrics and data during the operation of a database instance, including but not limited to Central Processing Unit (CPU) utilization, memory usage, disk I / O throughput, and transaction processing latency. Performance information reflects the overall operating status of the database and the usage of data tables; it can include both the performance load on the instance and the performance load on the data tables.

[0053] The first time window for the first index can be matched based on multiple dimensions, such as the overall database load and the access frequency of related tables. For example, if the data table associated with the first index is accessed less frequently between 2:00 AM and 4:00 AM, and the overall database load is low between 2:00 AM and 4:00 AM, then the period between 2:00 AM and 4:00 AM can be used as the first time window.

[0054] Once a suitable first time window is found, the system will perform the index deletion operation within that window, which can reduce the impact of deleting indexes on database performance and improve system stability.

[0055] In this embodiment, by matching a first time window based on performance information and deleting the first index within the first time window, the system can ensure that the index deletion operation will not have a significant impact on database performance, thereby improving the overall operating efficiency of the database and achieving more intelligent and efficient automatic index management.

[0056] In some embodiments of this application, a second index is added based on performance information, including: The second time window of the second index is matched based on performance information; A second index is added based on the second time window.

[0057] In practical applications, the second time window refers to a time period selected based on performance information evaluation that has the least impact on the overall database performance. Performing the operation of adding a second index within this specific time period has the least impact on the overall database performance. For example, if the database load is at its lowest level during the night and early morning hours, the second index can be added during this time period to avoid maintenance operations on the second index during peak business hours, thereby reducing the impact on user business operations.

[0058] By matching a second time window for the second index based on performance information, high-load periods for the database can be avoided, thereby reducing performance fluctuations caused by adding a second index. Executing the operation of adding a second index may involve multiple sub-steps, such as changes to the table structure, second index construction, and transaction processing, and these sub-steps are all limited to completion within low-load periods.

[0059] Adding a second index based on the second time window can make full use of idle database resources, efficiently complete the task of adding a second index, improve database performance, and reduce interference with online business. In some embodiments of this application, the method further includes: Generate a database index usage profile based on runtime and performance information; Based on the index usage profile, the frequency of index usage for each data table in the target time period is predicted to obtain the prediction results. Adjust the structure and / or state of the index based on the prediction results before the target time period.

[0060] In practical applications, refer to Figure 4 As shown, by correlating operational and performance information, we can determine the activity level, usage frequency, and impact on system performance of each index over different time periods, thus creating an index usage profile. Database index usage profiles can be presented in a visual or structured manner, such as heatmaps, trend charts, or statistical tables.

[0061] Once the index usage profile is obtained, it can be separated to determine the usage patterns of each index in the database. For example, in the order processing module of an e-commerce system, some indexes may only be frequently accessed during promotional activities, while being rarely used in daily operations. By separating the index usage profile, these periodically active indexes can be identified.

[0062] Based on the usage profile of the detached index, the pattern of index usage can be determined. (Refer to...) Figure 5 As shown, the usage pattern of index 1 is that it is frequently used in February, April, and June of each year, while it is almost never used in January, March, and May.

[0063] Index usage frequency prediction can be achieved using time series analysis, machine learning algorithms, and other methods. The target time period is a set future time period, and the system completes pre-maintenance work for specific indexes before the start of this target time period.

[0064] The prediction results can include information such as the probability of index usage, peak usage, and usage distribution. Index structure adjustments include adding new indexes, deleting old indexes, merging index fields, and modifying index types. Index status adjustments involve enabling, disabling, and rebuilding indexes. The decision to execute index structure and status adjustments, as well as the timing of execution, can be based on the prediction results. For example, for indexes predicted to see a significant increase in usage frequency in the coming weeks, the database management system can create the indexes in advance during the current off-peak period to ensure maximum performance during periods of high demand; conversely, for indexes predicted to be unused for a long period, the database management system can delete the indexes in advance during periods of low impact to free up storage space and computing resources.

[0065] Furthermore, the index adjustment process needs to consider the overall load of the database instance and select a time window with the least impact on system performance. For example, the index rebuild operation can be performed by the database management system when system pressure is low in the early morning, thereby reducing the impact on online services and avoiding interference.

[0066] Based on the same inventive concept as described above, Figure 6 This is a schematic diagram of a data processing device provided in an embodiment of the present invention. The device includes: The acquisition unit 601 is used to acquire performance information and operation information of the database when performing business operations; the operation information is used to indicate information associated with the operation status of each data table in the database. The processing unit 602 is used to determine the maintenance information of the database based on the operating information; the maintenance information is used to indicate the first index to be deleted and / or the second index to be added in the database; Processing unit 602 is used to delete the first index and / or add the second index based on performance information.

[0067] In some embodiments of this application, the runtime information includes the execution rate information of the structured query language statement and the index usage frequency information of the indexes corresponding to each data table; the processing unit 602 is used to obtain the table structure information of each data table; The first index is determined based on table structure information and index usage frequency information; The second index is determined based on table structure information and execution rate information.

[0068] In some embodiments of this application, the processing unit 602 is used to determine a third index from the database based on index usage frequency information; the index usage frequency of the third index is less than a first threshold. The first index is determined based on the table structure information of the data table corresponding to the third index.

[0069] In some embodiments of this application, the processing unit 602 is used to determine the target structured query language statement from the database based on execution rate information; the execution rate of the target structured query language statement is less than a second threshold. The second index is determined based on the table structure information of the data table corresponding to the target structured query language statement.

[0070] In some embodiments of this application, processing unit 602 is used to match a first time window of a first index based on performance information; The first index is deleted based on the first time window.

[0071] In some embodiments of this application, processing unit 602 is used to match a second time window of a second index based on performance information; A second index is added based on the second time window.

[0072] In some embodiments of this application, processing unit 602 is used to generate an index usage profile of the database based on runtime information and performance information; Based on the index usage profile, the frequency of index usage for each data table in the target time period is predicted to obtain the prediction results. Adjust the structure and / or state of the index based on the prediction results before the target time period.

[0073] Based on the foregoing embodiments, embodiments of this application provide an electronic device. Figure 7 This is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. The electronic device 700 includes at least one processor 701 and a memory 702. Optionally, the electronic device 700 may further include at least one communication interface 703. The various components in the electronic device 700 are coupled together through a bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 7 The general designated all buses as Bus System 704.

[0074] Based on the hardware implementation of the above program modules, the communication interface 703 is able to interact with other communication devices. The processor 701 is connected to the communication interface 703 to enable information exchange with other communication devices and to execute the methods provided by one or more of the above-mentioned technical solutions when running a computer program; Memory 702, computer programs are stored in memory 702.

[0075] Specifically, processor 701 is used to obtain performance information and operational information when the database performs business operations; the operational information is used to indicate information associated with the operational status of each data table in the database; The maintenance information of the database is determined based on the operational information; the maintenance information is used to indicate the first index to be deleted and / or the second index to be added in the database; Delete the first index and / or add the second index based on performance information.

[0076] In some embodiments of this application, the runtime information includes the execution rate information of the Structured Query Language statement and the index usage frequency information of the indexes corresponding to each data table; the processor 701 is used to obtain the table structure information of each data table; The first index is determined based on table structure information and index usage frequency information; The second index is determined based on table structure information and execution rate information.

[0077] In some embodiments of this application, processor 701 is configured to determine a third index from the database based on index usage frequency information; the index usage frequency of the third index is less than a first threshold. The first index is determined based on the table structure information of the data table corresponding to the third index.

[0078] In some embodiments of this application, processor 701 is configured to determine a target structured query language statement from a database based on execution rate information; the execution rate of the target structured query language statement is less than a second threshold. The second index is determined based on the table structure information of the data table corresponding to the target structured query language statement.

[0079] In some embodiments of this application, processor 701 is used to match a first time window of a first index based on performance information; The first index is deleted based on the first time window.

[0080] In some embodiments of this application, processor 701 is used to match a second time window of a second index based on performance information; A second index is added based on the second time window.

[0081] In some embodiments of this application, processing unit 602 is used to generate an index usage profile of the database based on runtime information and performance information; Based on the index usage profile, the frequency of index usage for each data table in the target time period is predicted to obtain the prediction results. Adjust the structure and / or state of the index based on the prediction results before the target time period.

[0082] It is understood that memory 702 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 702 described in this embodiment of the invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0083] The memory 702 in this embodiment of the invention is used to store various types of data to support the operation of the electronic device 700. Examples of such data include any computer program for operation on the electronic device 700, and programs implementing the methods of this embodiment of the invention may be included in the memory 702.

[0084] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 701. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method.

[0085] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the methods described above.

[0086] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the data processing method described in this application.

[0087] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the data processing method provided in this application. For example, ... Figure 1 The data processing method is shown.

[0088] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0089] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0090] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0091] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0092] In summary, this application determines the first index to be deleted and / or the second index to be added in the database based on the performance information of the database when performing business operations; deletes the first index and / or adds the second index based on the performance information; solves the problem of lagging index maintenance in related technologies, realizes timely database maintenance, and reduces the performance impact of index maintenance on the database.

[0093] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A data processing method, characterized in that, The method includes: Obtain performance and operational information of the database during business operations; the operational information is used to indicate information associated with the operational status of each data table in the database; The maintenance information of the database is determined based on the operational information; the maintenance information is used to indicate the first index to be deleted and / or the second index to be added in the database; Based on the performance information, delete the first index and / or add the second index.

2. The method according to claim 1, characterized in that, The operational information includes the execution rate information of Structured Query Language statements and the index usage frequency information of the indexes corresponding to each data table; the determination of the database maintenance information based on the operational information includes: Obtain the table structure information of each data table; The first index is determined based on the table structure information and the index usage frequency information; The second index is determined based on the table structure information and the execution rate information.

3. The method according to claim 2, characterized in that, Determining the first index based on the table structure information and the index usage frequency information includes: A third index is determined from the database based on the index usage frequency information; the index usage frequency of the third index is less than a first threshold. The first index is determined based on the table structure information of the data table corresponding to the third index.

4. The method according to claim 2, characterized in that, Determining the second index based on the table structure information and the execution rate information includes: The target structured query language statement is determined from the database based on the execution rate information; the execution rate of the target structured query language statement is less than a second threshold. The second index is determined based on the table structure information of the data table corresponding to the target structured query language statement.

5. The method according to claim 1, characterized in that, Deleting the first index based on the performance information includes: The first time window of the first index is matched based on the performance information; The first index is deleted based on the first time window.

6. The method according to claim 1, characterized in that, Adding the second index based on the performance information includes: The second time window of the second index is matched based on the performance information; The second index is added based on the second time window.

7. The method according to claim 1, characterized in that, The method further includes: Generate an index usage profile for the database based on the operational information and the performance information; Based on the index usage profile, the index usage frequency of the corresponding indexes of each data table in the target time period is predicted to obtain the prediction result; Based on the prediction results, the structure and / or state of the index are adjusted before the target time period.

8. An electronic device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 7.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.