Method and device for processing index expansion

By creating an index maintenance information table in the database, and automatically judging and processing index inflation, the problem of manual intervention in the existing technology requires manual intervention, and automated batch processing without manual intervention is realized, and efficiency and user experience are improved.

CN119166638APending Publication Date: 2024-12-20CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411324874.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The prior art requires manual intervention when dealing with database index bloat, especially when batch index reconstruction may cause blockage to the business, and it is difficult to achieve automated batch processing, affecting efficiency and user experience.

Method used

By creating an index maintenance information table in the database, we automatically judge the index inflation situation, and decide whether to rebuild the index based on the index size and historical data. When rebuilding the index, we use the historical time mean to determine whether to terminate the process, so as to realize online index reconstruction without manual intervention.

Benefits of technology

It realizes the expansion of automated batch processing index without manual intervention, improves processing efficiency, reduces business impact, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166638A_ABST
    Figure CN119166638A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for processing index expansion, and belongs to the technical field of index expansion processing. The method comprises the steps that an index maintenance information table is created in a database; judging whether the index is expanded or not according to the current size of the index and index size data in an index maintenance information table; if the judgment result is index expansion, determining that the index needs to be reconstructed; the indexes needing to be reconstructed are sequentially added into the index maintenance information table, and the indexes are reconstructed according to the sequence of the indexes needing to be reconstructed in the index maintenance information table and the index reconstruction process; when the index is reconstructed, the current index reconstruction time is determined, the historical time mean value of index reconstruction is determined according to the index reconstruction time information in the index maintenance information table, and whether the index reconstruction needs to be terminated or not is judged according to the current index reconstruction time and the historical time mean value of the index reconstruction. The whole process of processing the expansion index does not need manual intervention, automatic batch completion is achieved, efficiency is high, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of processing index expansion, and in particular, relates to a method and device for processing index expansion. Background Art

[0002] Database index is an important component in database management system, which is used to help speed up the retrieval of data in database tables. Without index, query operation may need to scan the entire database table, which is very inefficient when the amount of data is large. By creating index, the database can significantly improve query performance and optimize the speed of data retrieval.

[0003] Although indexes can improve query performance, they also take up additional storage space and may increase the overhead of insert, update, and delete operations; as data is added, deleted, and modified, indexes may become bloated; bloating means that the index structure is no longer compact, resulting in degraded query performance; for example, when data is deleted, some holes may be left in the index, which will reduce query efficiency. Bloated indexes take up more storage space, which may lead to insufficient disk space. By rebuilding the index, unused space can be freed up and storage efficiency can be improved. Rebuilding the index can reorganize the index structure to make it more compact and efficient, which helps reduce I / O operations during queries and improve query speed.

[0004] In order to avoid affecting the business, the existing technology generally uses the ONLINE method during non-business peak hours when rebuilding a single index. This will not affect the current business, but rarely considers sudden business, which may cause business obstruction, especially the backlog caused by batch index rebuilding. General index rebuilding often requires manual processing. When it involves the processing of multiple indexes, it is difficult to achieve batch automatic processing, which requires a lot of manual intervention and intervention. Summary of the invention

[0005] In view of the above deficiencies in the prior art, the purpose of the present invention is to provide a method and device for processing index expansion, which can automatically complete the processing of online expanded indexes in batches without manual intervention.

[0006] A first aspect of the present invention provides a method for processing index expansion, comprising:

[0007] Create an index maintenance information table in the database;

[0008] Determine whether the index is expanded based on the current size of the index and the index size data in the index maintenance information table;

[0009] If the result of the judgment is that the index is expanded, it is determined that the index needs to be rebuilt;

[0010] Add the indexes that need to be rebuilt to the index maintenance information table in sequence, and rebuild the indexes according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index rebuilding process;

[0011] When rebuilding an index, determine the current time of rebuilding the index, determine the historical average time of rebuilding the index based on the rebuilding index time information in the index maintenance information table, and determine whether to terminate the rebuilding of the index based on the current time of rebuilding the index and the historical average time of rebuilding the index.

[0012] Furthermore, in the above method for processing index expansion, judging whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table includes:

[0013] Determine whether the index is bloated based on the current size of the index and the historical size of the index in the index maintenance information table;

[0014] If the judgment result is that the current size of the index is greater than the historical size of the index, the index is expanded.

[0015] Furthermore, in the above method for processing index expansion, judging whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table includes:

[0016] Determine whether the index is bloated based on the current size of the index and the historical size of the index in the index maintenance information table;

[0017] If the judgment result is that the current size of the index is less than or equal to the historical size of the index, the index has not expanded.

[0018] Furthermore, in the above method for processing index expansion, judging whether to terminate the index reconstruction according to the current index reconstruction time and the historical average time of the index reconstruction includes:

[0019] If the time required for the current index rebuild is greater than twice the average time of the historical index rebuild, the index rebuild will be terminated.

[0020] Furthermore, in the above method for processing index expansion, judging whether to terminate the index reconstruction according to the current index reconstruction time and the historical average time of the index reconstruction further includes:

[0021] If the time required for the current index rebuild is less than or equal to twice the average time of the historical index rebuild, continue to rebuild the index.

[0022] Furthermore, in the above method for processing index expansion, determining the current time for rebuilding the index includes:

[0023] Get the start time and end time of the current index rebuild;

[0024] The time of the current index rebuilding is determined according to the difference between the end time of the current index rebuilding and the start time of the previous index rebuilding.

[0025] Furthermore, in the above method for processing index expansion, determining the historical average time of index reconstruction according to the index reconstruction time information in the index maintenance information table includes:

[0026] Get the historical rebuild time of each index;

[0027] The historical average time for rebuilding the index is determined according to the historical rebuild time of each index.

[0028] A second aspect of the present invention further provides a device for processing index expansion, comprising:

[0029] Creation module: used to create index maintenance information table in the database;

[0030] The first judgment module is used to judge whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table;

[0031] Determination module: used to determine that the index needs to be rebuilt if the judgment result is that the index is expanded;

[0032] Re-indexing module: used to add the indexes that need to be rebuilt to the index maintenance information table in sequence, and rebuild the indexes according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index rebuilding process;

[0033] The second judgment module: when rebuilding the index, determines the current time of rebuilding the index, determines the historical average time of rebuilding the index according to the information of rebuilding the index time in the index maintenance information table, and determines whether to terminate the rebuilding of the index according to the current time of rebuilding the index and the historical average time of rebuilding the index.

[0034] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;

[0035] The processor calls the program or instruction stored in the memory to execute any one of the above methods for processing index expansion.

[0036] In a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute any one of the above methods for processing index expansion.

[0037] The beneficial effects of the present invention are as follows: the present invention creates an index maintenance information table in a database; determines whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table; if the judgment result is that the index is expanded, determines that the index needs to be rebuilt; adds the indexes that need to be rebuilt to the index maintenance information table in sequence, and rebuilds the index according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index reconstruction process; when rebuilding the index, determines the current time of rebuilding the index, determines the historical time mean of rebuilding the index according to the index reconstruction time information in the index maintenance information table, and determines whether the reconstruction of the index needs to be terminated according to the current time of rebuilding the index and the historical time mean of rebuilding the index. The entire process of processing the expanded index of the present invention does not require manual intervention, and is completed automatically in batches, which is not only efficient but also improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0039] Figure 1 A method diagram for processing index expansion provided by an embodiment of the present invention;

[0040] Figure 2 A method for determining whether an index is expanded provided by an embodiment of the present invention Figure 1 ;

[0041] Figure 3 A method for determining whether an index is expanded provided by an embodiment of the present invention Figure 2 ;

[0042] Figure 4 A method diagram for determining the current time for rebuilding an index provided by an embodiment of the present invention;

[0043] Figure 5 A method diagram for determining the historical time mean of re-indexing provided by an embodiment of the present invention;

[0044] Figure 6 A diagram of a device for processing index expansion provided by an embodiment of the present invention;

[0045] Figure 7 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0047] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0048] In the description of the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be internal communication between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0050] The present invention provides a method, device, electronic device and storage medium for processing index expansion, which can automatically complete the processing of online expanded indexes in batches without manual intervention.

[0051] Before introducing the embodiments of the present invention, professional terms involved in the present invention are first introduced.

[0052] Index bloat: Indexes can improve query performance, but they also take up additional storage space and can increase the overhead of insert, update, and delete operations. Indexes can become bloated as data is added, deleted, or modified. Bloat means that the index structure is no longer compact, resulting in degraded query performance. For example, when data is deleted, there may be holes left in the index that can reduce query efficiency.

[0053] Automatic batch processing: put frequently updated tables into a list, and batch process the indexes involved in the list. If you need to process other indexes later, just put the tables involved into the list. For indexes that no longer need to be processed, just delete them from the list.

[0054] Online index rebuilding: The problem solved by online index rebuilding is to ensure that the rebuilding process does not affect ongoing query and update operations.

[0055] Method Embodiment

[0056] Figure 1 A diagram of a method for processing index expansion provided by an embodiment of the present invention.

[0057] In a first aspect of the present invention, a method for processing index expansion is proposed, combining Figure 1 , including five steps from S1 to S5:

[0058] S1: Create an index maintenance information table in the database.

[0059] Specifically, in an embodiment of the present invention, the information in the index maintenance information table includes at least: index name, start time of index reconstruction, end time of index reconstruction, historical size of index, success or failure of index reconstruction, index that needs to be rebuilt and index reconstruction process.

[0060] S2: Determine whether the index is expanded based on the current size of the index and the index size data in the index maintenance information table.

[0061] Specifically, in an embodiment of the present invention, a method for determining whether an index is expanded based on the current size of the index and the index size data in the index maintenance information table is described in detail below.

[0062] S3: If the result of the determination is that the index is expanded, it is determined that the index needs to be rebuilt.

[0063] Specifically, in the embodiment of the present invention, if the result of judging based on the current size of the index and the index size data in the index maintenance information table is that the index is expanded, it is determined that the index needs to be rebuilt.

[0064] S4: The indexes that need to be rebuilt are added to the index maintenance information table in sequence, and the indexes are rebuilt according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index reconstruction process.

[0065] Specifically, in an embodiment of the present invention, all expanded indexes that need to be rebuilt are added to the index maintenance information table in sequence. When rebuilding the index, the index that needs to be rebuilt in the index maintenance information table is read, and the index that needs to be rebuilt is rebuilt one by one according to the order of the index that needs to be rebuilt and the index reconstruction process. The rebuilt indexes in the present invention are all online rebuilt indexes.

[0066] S5: When rebuilding the index, determine the current time of rebuilding the index, determine the historical average time of rebuilding the index according to the information of rebuilding the index time in the index maintenance information table, and judge whether to terminate the rebuilding of the index according to the current time of rebuilding the index and the historical average time of rebuilding the index.

[0067] Specifically, in an embodiment of the present invention, the time for currently rebuilding an index is determined by the start time of the currently rebuilding an index and the end time of the currently rebuilding an index, and the historical time average for rebuilding an index is determined by the historical rebuild time of each index. The method for determining the time for currently rebuilding an index, determining the historical time average for rebuilding an index, and judging whether it is necessary to terminate rebuilding an index based on the time for currently rebuilding an index and the historical time average for rebuilding an index are described in detail below.

[0068] The above steps do not require manual intervention, and the processing of online expansion indexes is completed automatically in batches.

[0069] Figure 2 A method for determining whether an index is expanded provided by an embodiment of the present invention Figure 1 .

[0070] Furthermore, in the above method for processing index expansion, whether the index is expanded is determined based on the current size of the index and the index size data in the index maintenance information table, and combined with Figure 2 , including two steps from S21 to S22:

[0071] S21: judging whether the index is expanded according to the current size of the index and the historical size of the index in the index maintenance information table;

[0072] S22: If the judgment result is that the current size of the index is greater than the historical size of the index, the index expands.

[0073] Specifically, whether the index has expanded is determined based on the current size of the index and the historical size of the index in the index maintenance information table. The index has the same name as the index. That is, whether the index has expanded is determined by comparing the current size and historical size of the same index. If the current size of the index is greater than the historical size of the index, it is determined that the index has expanded.

[0074] Figure 3 A method for determining whether an index is expanded provided by an embodiment of the present invention Figure 2 .

[0075] Furthermore, in the above method for processing index expansion, whether the index is expanded is determined based on the current size of the index and the index size data in the index maintenance information table, and combined with Figure 3 , including two steps from S31 to S32:

[0076] S31: judging whether the index is expanded according to the current size of the index and the historical size of the index in the index maintenance information table;

[0077] S32: If the judgment result is that the current size of the index is less than or equal to the historical size of the index, the index has not expanded.

[0078] Specifically, whether the index has expanded is determined based on the current size of the index and the historical size of the index in the index maintenance information table. For indexes with the same name, that is, whether the index has expanded is determined by comparing the current size and historical size of the same index. If the current size of the index is less than or equal to the historical size of the index, it is determined that the index has not expanded.

[0079] Furthermore, in the above method for processing index expansion, judging whether to terminate the index reconstruction according to the current index reconstruction time and the historical average time of the index reconstruction includes:

[0080] If the time required for the current index rebuild is greater than twice the average time of the historical index rebuild, the index rebuild will be terminated.

[0081] Specifically, in an embodiment of the present invention, if the current time for rebuilding the index is much longer than the historical average time for rebuilding the index, such as the time required for the current rebuilding the index is more than twice the historical average time for rebuilding the index, it may be a sudden business peak, and the rebuilding of the index is terminated.

[0082] Furthermore, in the above method for processing index expansion, judging whether to terminate the index reconstruction according to the current index reconstruction time and the historical average time of the index reconstruction further includes:

[0083] If the time required for the current index rebuild is less than or equal to twice the average time of the historical index rebuild, continue to rebuild the index.

[0084] Specifically, in the embodiment of the present invention, if the current index rebuilding time is less than or equal to twice the average of the historical time for rebuilding the index, then it is not a sudden business peak, and the index rebuilding continues.

[0085] Figure 4 A diagram of a method for determining the current time for rebuilding an index provided by an embodiment of the present invention.

[0086] Furthermore, in the above method for processing index expansion, the current time for rebuilding the index is determined, combined with Figure 4 , including two steps from S41 to S42:

[0087] S41: Obtain the start time and end time of the current index rebuilding;

[0088] S42: Determine the time of the current index rebuilding according to the difference between the end time of the current index rebuilding and the start time of the previous index rebuilding.

[0089] Specifically, in an embodiment of the present invention, the start time and the end time of the current index reconstruction are recorded in the index maintenance information table, and the time required for the current reconstruction of the entire index is determined by the difference between the start time and the end time of the current index reconstruction.

[0090] Figure 5 A method diagram for determining the historical time mean of re-indexing provided in an embodiment of the present invention.

[0091] Furthermore, in the above method for processing index expansion, the historical average time of re-indexing is determined according to the index re-indexing time information in the index maintenance information table, and combined with Figure 5 , including two steps from S51 to S52:

[0092] S51: Obtain the historical reconstruction time of each index;

[0093] S52: Determine the historical time average of rebuilding the index according to the historical rebuilding time of each index.

[0094] Specifically, in the embodiment of the present invention, the historical reconstruction time of each index is obtained from the index maintenance information table, and the average historical time of reconstructing the index can be determined by averaging the historical time of multiple reconstructions of each index.

[0095] Device Embodiment

[0096] Figure 6 A diagram of a device for processing index expansion provided by an embodiment of the present invention.

[0097] In a second aspect of the present invention, a device for processing index expansion is also provided, combining Figure 6 ,include:

[0098] Creation module 61: used to create an index maintenance information table in the database.

[0099] Specifically, in an embodiment of the present invention, the information in the index maintenance information table created by the creation module 61 in the database includes at least: the index name, the start time of the index reconstruction, the end time of the index reconstruction, the historical size of the index, whether the index reconstruction is successful or not, the index that needs to be rebuilt, and the index reconstruction process.

[0100] The first judgment module 62 is used to judge whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table.

[0101] Specifically, in the embodiment of the present invention, the first judgment module 62 judges whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table.

[0102] Determining module 63: for determining that the index needs to be rebuilt if the determination result is that the index is expanded.

[0103] Specifically, in the embodiment of the present invention, the determination module 63 is used to determine that the index needs to be rebuilt if the result of the determination based on the current size of the index and the index size data in the index maintenance information table is that the index is expanded.

[0104] The index rebuilding module 64 is used to sequentially add the indexes that need to be rebuilt into the index maintenance information table, and rebuild the indexes according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index rebuilding process.

[0105] Specifically, in an embodiment of the present invention, the index reconstruction module 64 is used to add all the expanded indexes that need to be rebuilt to the index maintenance information table in sequence. When rebuilding the index, the index that needs to be rebuilt in the index maintenance information table is read, and the index that needs to be rebuilt is rebuilt one by one according to the order of the indexes that need to be rebuilt and the index reconstruction process.

[0106] The second judgment module 65 is used to determine the current time of re-indexing when re-indexing, determine the historical time average of re-indexing according to the time information of re-indexing in the index maintenance information table, and judge whether to terminate the re-indexing according to the current time of re-indexing and the historical time average of re-indexing.

[0107] Specifically, in the embodiment of the present invention, the second judgment module 65 determines the current time of re-indexing by the start time of the current re-indexing and the end time of the current re-indexing, determines the historical time mean of re-indexing by the historical reconstruction time of each index, determines the current time of re-indexing, determines the historical time mean of re-indexing, and judges whether it is necessary to terminate the re-indexing based on the current time of re-indexing and the historical time mean of re-indexing.

[0108] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;

[0109] The processor calls the program or instruction stored in the memory to execute any one of the above methods for processing index expansion.

[0110] In a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute any one of the above methods for processing index expansion.

[0111] Figure 7It is a schematic block diagram of an electronic device provided by an embodiment of the present invention.

[0112] like Figure 7 As shown, the electronic device includes: at least one processor 701, at least one memory 702 and at least one communication interface 703. The various components in the electronic device are coupled together through a bus system 704. The communication interface 703 is used to transmit information between external devices. It can be understood that the bus system 704 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .

[0113] It can be understood that the memory 702 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.

[0114] In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.

[0115] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method of a method for processing index expansion provided in an embodiment of the present invention can be included in the application.

[0116] In an embodiment of the present invention, the processor 701 calls a program or instruction stored in the memory 702, specifically, a program or instruction stored in an application, and the processor 701 is used to execute the steps of each embodiment of a method for processing index expansion provided in an embodiment of the present invention.

[0117] Create an index maintenance information table in the database;

[0118] Determine whether the index is expanded based on the current size of the index and the index size data in the index maintenance information table;

[0119] If the result of the judgment is that the index is expanded, it is determined that the index needs to be rebuilt;

[0120] Add the indexes that need to be rebuilt to the index maintenance information table in sequence, and rebuild the indexes according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index rebuilding process;

[0121] When rebuilding the index, determine the time of the current index rebuilding, determine the historical time mean of the index rebuilding according to the index rebuilding time information in the index maintenance information table, and determine whether it is necessary to terminate the index rebuilding according to the current index rebuilding time and the historical time mean of the index rebuilding. Any method of the method for processing index expansion provided in an embodiment of the present invention can be applied to the processor 701, or implemented by the processor 701. The processor 701 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 701 or an instruction in the form of software. The above-mentioned processor 701 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0122] The steps of any method in a method for processing index expansion provided by an embodiment of the present invention can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in the decoding processor. The software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702 and completes the steps of the method in combination with its hardware.

[0123] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

[0124] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0125] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

[0126] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for processing index expansion, characterized in that: include: Create an index maintenance information table in the database; Determine whether the index is expanded based on the current size of the index and the index size data in the index maintenance information table; If the result of the judgment is that the index is expanded, it is determined that the index needs to be rebuilt; Add the indexes that need to be rebuilt to the index maintenance information table in sequence, and rebuild the indexes according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index rebuilding process; When rebuilding an index, determine the current time of rebuilding the index, determine the historical average time of rebuilding the index based on the rebuilding index time information in the index maintenance information table, and determine whether to terminate the rebuilding of the index based on the current time of rebuilding the index and the historical average time of rebuilding the index.

2. A method for processing index expansion according to claim 1, characterized in that: The step of judging whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table includes: Determine whether the index is expanded according to the current size of the index and the historical size of the index in the index maintenance information table; If the judgment result is that the current size of the index is greater than the historical size of the index, the index expands.

3. A method for processing index expansion according to claim 1, characterized in that: The step of judging whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table includes: Determine whether the index is expanded according to the current size of the index and the historical size of the index in the index maintenance information table; If the judgment result is that the current size of the index is less than or equal to the historical size of the index, then the index has not expanded.

4. A method for processing index expansion according to claim 1, characterized in that: The determining whether to terminate the index rebuilding according to the current index rebuilding time and the historical index rebuilding time average includes: If the time required for the current index rebuild is greater than twice the average time of the historical index rebuild, the index rebuild will be terminated.

5. The method for processing index expansion according to claim 1, characterized in that: The step of judging whether to terminate the index rebuilding according to the current index rebuilding time and the historical index rebuilding time average includes: If the time required for the current index rebuild is less than or equal to twice the average time of the historical index rebuild, continue to rebuild the index.

6. A method for processing index expansion according to claim 1, characterized in that: The determining of the current index rebuilding time includes: Get the start time and end time of the current index rebuild; The time of the current index rebuilding is determined according to the difference between the end time of the current index rebuilding and the start time of the previous index rebuilding.

7. A method for processing index expansion according to claim 1, characterized in that: Determining the historical time average of index reconstruction according to the index reconstruction time information in the index maintenance information table includes: Get the historical rebuild time of each index; The historical average time for rebuilding the index is determined according to the historical rebuild time of each index.

8. A device for processing index expansion, characterized in that: include: Creation module: used to create index maintenance information table in the database; The first judgment module is used to judge whether the index is expanded according to the current size of the index and the index size data in the index maintenance information table; Determination module: used to determine that the index needs to be rebuilt if the judgment result is that the index is expanded; Re-indexing module: used to add the indexes that need to be rebuilt to the index maintenance information table in sequence, and rebuild the indexes according to the order of the indexes that need to be rebuilt in the index maintenance information table and the index rebuilding process; The second judgment module: when rebuilding the index, determines the current time of rebuilding the index, determines the historical average time of rebuilding the index according to the information of rebuilding the index time in the index maintenance information table, and determines whether to terminate the rebuilding of the index according to the current time of rebuilding the index and the historical average time of rebuilding the index.

9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute the method for processing index expansion as described in any one of claims 1 to 7 by calling the program or instruction stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a method for processing index expansion as described in any one of claims 1 to 7.