Method, system and equipment for improving btree index parallel creation performance

By introducing a producer-consumer mechanism, the main thread and producer thread respectively process the parallel-generated sorted segments and merged data, which solves the performance degradation problem of the multi-way merge stage in the parallel creation of btree indexes and achieves more efficient index creation.

CN118939658APending Publication Date: 2024-11-12BEIJING VASTDATA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410996508.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

During the parallel creation of btree indexes, the performance degradation problem in the multi-way merge phase could not be effectively solved as the degree of parallelism increased, affecting the overall performance improvement.

Method used

A producer-consumer mechanism is introduced, with the main thread and producer thread handling the parallel-generated sorted segments and merged data respectively, and a shared cache used for data transfer, reducing the performance degradation in the final merge stage.

Benefits of technology

It maintains the performance gains from parallelism in scanning and sorting, while reducing the performance degradation caused by increased parallelism, thus improving the overall performance of creating btree indexes in parallel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939658A_ABST
    Figure CN118939658A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of index creation, and provides a method, system and device for improving the performance of creating btree indexes in parallel, and the method comprises the steps: adopting parallel sub-threads to carry out parallel scanning and sorting on data, and generating a plurality of paths of sorting segments; when the parallel sub-threads finish parallel scanning and sorting of the data, a shared cache is created through the main thread, and the producer thread is started; performing multi-path merging on the generated multi-path sorting section through the started producer thread, and writing ordered data generated by multi-path merging into a shared cache; and reading the ordered data from the shared cache through the main thread, creating an index tuple according to the read ordered data, and writing the created index tuple into the index table. According to the method, the system and the equipment for improving the performance of creating the btree indexes in parallel, the scanning and sorting performance gain caused by improving the parallelism degree can be kept, and meanwhile, the performance degradation caused by increasing the parallelism degree in the final merging stage is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of index creation, and in particular to a method, system and device for improving the performance of parallel creation of btree indexes. Background Art

[0002] The multi-way merge algorithm is a sorting algorithm used to process large amounts of data. It is based on the idea of ​​merge sort, but is extended to situations where multiple ordered sequences can be merged simultaneously. This algorithm is particularly suitable for processing large data sets. When the data set is too large to be loaded into memory at one time, the multi-way merge algorithm can effectively perform sorting and merging operations. The openGauss database uses the idea of ​​the multi-way merge algorithm to implement parallel creation of btree indexes, which mainly includes two steps: Step 1: parallel scan and sort the data to generate multi-way sorted segments; Step 2: merge the multi-way sorted segments, generate index data, and write them into the index table.

[0003] In practical applications, as the degree of parallelism increases, the number of sorted segments generated in step one will increase, and the time spent on multi-way merging in step two will also increase, exceeding the performance improvement brought by parallelism, and even causing performance degradation.

[0004] Therefore, how to provide a method for creating indexes in parallel, while maintaining the performance gains of scanning and sorting brought by increasing parallelism, and reducing the performance degradation caused by the increase in parallelism in the final merging stage, has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, in order to overcome the deficiencies of the prior art, the present invention aims to provide a method, system and device for improving the performance of parallel creation of btree indexes.

[0006] According to a first aspect of the present invention, a method for improving the performance of parallel creation of btree indexes is provided, the method comprising:

[0007] Use parallel subthreads to scan and sort data in parallel to generate multi-way sorting segments;

[0008] When the parallel child threads finish parallel scanning and sorting of data, they create a shared cache through the main thread and start the producer thread;

[0009] The generated multi-way sorted segments are multi-way merged by the started producer thread, and the ordered data generated by the multi-way merge is written into the shared cache;

[0010] The main thread reads ordered data from the shared cache, creates index tuples based on the read ordered data, and writes the created index tuples into the index table.

[0011] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, parallel sub-threads are used to perform parallel scanning and sorting of data to generate multi-way sorted segments, including: parallel sub-threads are used to perform parallel scanning of data, and data obtained by parallel scanning is sorted to generate multi-way sorted segments.

[0012] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, when the parallel sub-threads complete the parallel scanning and sorting of data, a shared cache is created through the main thread, and a producer thread is started, including: monitoring through the main thread whether the parallel sub-threads complete the parallel scanning and sorting of data, when it is monitored that the parallel sub-threads complete the parallel scanning and sorting of data, creating a shared cache through the main thread, starting the producer thread, and passing the address reference of the shared cache to the producer thread.

[0013] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, multi-way merging is performed on the generated multi-way sorted segments by starting a producer thread, and the ordered data generated by the multi-way merging is written into a shared cache, including: when the ordered data generated by the multi-way merging exceeds the cache size of the shared cache, the ordered data exceeding the cache size of the shared cache is written into the external memory in blocks, and an external memory usage flag is set for the shared cache.

[0014] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, ordered data is read from a shared cache by a main thread, and index tuples are created according to the read ordered data, including: when the ordered data in the shared cache has been read by the main thread and the shared cache is set with an external memory usage flag, the ordered data in the external memory is loaded into the shared cache in blocks, the ordered data is read from the shared cache by the main thread, and index tuples are created according to the read ordered data.

[0015] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, ordered data is read from the shared cache by the main thread, and index tuples are created according to the read ordered data, including: when the ordered data in the shared cache and the external memory have been read by the main thread, waiting for the producer thread to continue writing ordered data to the shared cache, reading ordered data from the shared cache by the main thread, and creating index tuples according to the read ordered data.

[0016] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, ordered data is read from the shared cache by the main thread, and index tuples are created according to the read ordered data. It also includes: when the ordered data in the shared cache and the external memory have been read by the main thread, the producer thread no longer continues to write ordered data to the shared cache, and the ordered data is read from the shared cache by the main thread. After the index tuple is created according to the read ordered data, an index creation and cleanup process is executed.

[0017] Preferably, in the method for improving the performance of parallel creation of btree indexes of the present invention, after creating index tuples based on the read ordered data, an index creation cleanup process is executed, including: releasing sub-parallel thread resources, sharing cache resources, closing the underlying storage and sending a notification that the index has been completed to the upper-level application.

[0018] According to a second aspect of the present invention, a system for improving the performance of parallel creation of btree indexes is provided, the system comprising an improving server, the improving server being used for: using parallel sub-threads to perform parallel scanning of data, and generating multi-way sorted segments by sorting the scanned data; when the parallel sub-threads complete the parallel scanning and sorting of the data, creating a shared cache through a main thread and starting a producer thread; performing multi-way merging on the generated multi-way sorted ends through the started producer thread, and writing the ordered data generated by the multi-way merging into the shared cache; reading the ordered data from the shared cache through the main thread, creating an index tuple according to the read ordered data, and writing the created index tuple into an index table.

[0019] According to a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the program.

[0020] The method, system and device for improving the performance of creating btree indexes in parallel of the present invention introduce a producer-consumer mechanism in the final merging stage of creating btree indexes in parallel in a database, and producers and consumers use different threads; the producer thread is responsible for multi-way merging of the sorted segments generated in parallel, and writing the output ordered data into a shared cache, while the consumer obtains the merged data from the shared cache, generates index data, and writes it into the index table. That is, the final merging stage of creating indexes in parallel in a database is improved from the original single thread to a producer-consumer method, and the merge sorting and index data generation are parallelized to improve the performance of the final merging. It can maintain the performance gains of scanning and sorting brought about by the increase in parallelism, while reducing the performance degradation brought about by the increase in parallelism in the final merging stage.

[0021] The method and system for improving the performance of parallel creation of btree indexes of the present invention are applicable to various databases that need to create indexes in parallel, such as openGauss database. According to engineering practice, in the final merging stage of parallel creation of indexes in many business scenarios, the time consumption of multi-way merge sorting and index data generation reaches 1:2 or even 1:1, and the method of this embodiment can effectively improve the performance of parallel creation of indexes.

[0022] When the method of the present invention is applied to the openGauss database, the final merging stage of the original parallel index creation is split into two parallel tasks. The producer is responsible for the original multi-way merge sorting, and the consumer is responsible for the original generation of index data and writing it into the index table. Only the producer-consumer framework needs to be implemented, and most of the logic can effectively utilize the existing logic in the openGauss database, reducing a lot of development work. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 An example diagram of a system for improving the performance of creating btree indexes in parallel according to an embodiment of the present invention;

[0025] Figure 2 A flowchart of a method for improving the performance of creating btree indexes in parallel according to an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of the structure of the device provided by the present invention. DETAILED DESCRIPTION

[0027] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0028] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.

[0029] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0030] The technical principles of the present invention are as follows:

[0031] The producer and consumer framework is implemented through two threads. After the main thread for creating the index detects that the parallel sub-thread responsible for scanning and sorting has finished, it starts a thread as a producer, which is responsible for multi-way merging of the sorted segments generated in the parallel phase and writing the sorted data generated by the merge into the shared cache. After the main thread for creating the index starts the producer thread, it reads data from the shared cache as a consumer thread, creates index tuples, and writes them into the index table.

[0032] The shared cache is responsible for caching the merged ordered data between the producer and consumer threads; the shared cache can be configured in size and supports external memory. When the ordered data generated by the producer thread exceeds the cache size, it is written to the external memory in blocks. When the consumer reads data from the shared cache, it finds that the data in the cache has been read and is marked as using external memory, so it loads the data from the external memory to the shared cache in blocks.

[0033] Figure 1 FIG. 1 is an example diagram of a system for improving the performance of creating btree indexes in parallel according to an embodiment of the present invention. Figure 1 As shown, the system may include an enhancement server 101, a communication network 102 and / or one or more enhancement clients 103. Figure 1 The example in FIG. 1 is a plurality of promotion clients 103 .

[0034] The boost server 101 can be any suitable server for storing information, data, programs and / or any other suitable type of content. In some embodiments, the boost server 101 can perform appropriate functions. For example, in some embodiments, the boost server 101 can be used to improve the performance of creating btree indexes in parallel. As an optional example, in some embodiments, the boost server 101 can be used to: use parallel sub-threads to scan and sort data in parallel to generate multi-way sorted segments; when the parallel sub-threads finish the parallel scanning and sorting of data, create a shared cache through the main thread and start the producer thread; perform multi-way merging of the generated multi-way sorted segments through the started producer thread, and write the ordered data generated by the multi-way merging into the shared cache; read the ordered data from the shared cache through the main thread, create index tuples based on the read ordered data, and write the created index tuples into the index table.

[0035] As another example, in some embodiments, the enhancement server 101 may send a method for enhancing the performance of parallel creation of btree indexes to the enhancement client 103 for the user to use according to a request of the enhancement client 103 .

[0036] As an optional example, in some embodiments, the enhancement client 103 is used to provide a visual enhancement interface, which is used to receive a user's selection input operation to improve the performance of parallel creation of btree indexes, and to, in response to the selection input operation, obtain from the enhancement server 101 an enhancement interface corresponding to the option selected by the selection input operation and display the enhancement interface, wherein the enhancement interface at least displays information on improving the performance of parallel creation of btree indexes and operation options for improving the information on improving the performance of parallel creation of btree indexes.

[0037] In some embodiments, the communication network 102 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 102 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN), and / or any other suitable communication network. The promotion client 103 can be connected to the communication network 102 via one or more communication links (e.g., communication link 104), and the communication network 102 can be linked to the promotion server 101 via one or more communication links (e.g., communication link 105). The communication link can be any communication link suitable for transmitting data between the promotion client 103 and the promotion server 101, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link, or any suitable combination of such links.

[0038] The promotion client 103 may include any one or more clients that present an interface related to the promotion of parallel creation of btree index performance in an appropriate form for use and operation by a user. In some embodiments, the promotion client 103 may include any suitable type of device. For example, in some embodiments, the promotion client 103 may include a mobile device, a tablet computer, a laptop computer, a desktop computer and / or any other suitable type of client device.

[0039] Although the boost server 101 is illustrated as one device, in some embodiments, any suitable number of devices may be used to perform the functions performed by the boost server 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the boost server 101. Alternatively, the functions of the boost server 101 may be implemented using a cloud service.

[0040] Based on the above system, an embodiment of the present application provides a method for improving the performance of parallel creation of btree indexes, which is described below through the following embodiments.

[0041] Figure 2The flowchart of the method for improving the performance of parallel creation of btree indexes according to an embodiment of the present invention is as follows. The method for improving the performance of parallel creation of btree indexes according to the present embodiment can be executed on the server side, such as Figure 2 As shown, the method for improving the performance of parallel creation of btree indexes includes the following steps:

[0042] Step S201: Use parallel sub-threads to scan and sort data in parallel to generate multiple sorting segments.

[0043] As an optional example, in the method of this embodiment, parallel sub-threads are used to scan data in parallel, and the data obtained by the parallel scanning is sorted to generate multiple sorting segments.

[0044] Step S202: When the parallel sub-threads finish the parallel scanning and sorting of the data, a shared cache is created through the main thread and the producer thread is started.

[0045] As an optional example, in the method of this embodiment, the main thread monitors whether the parallel sub-threads have completed the parallel scanning and sorting of the data. When the parallel sub-threads are monitored to have completed the parallel scanning and sorting of the data, the main thread creates a shared cache, starts the producer thread, and passes the address reference of the shared cache to the producer thread. In this embodiment, by passing the address reference of the shared cache to the producer thread, the producer thread and the main thread as the consumer thread can transfer data through the shared cache.

[0046] Step S203: multi-way merging is performed on the generated multi-way sorted segments through the started producer thread, and the ordered data generated by the multi-way merging is written into the shared cache.

[0047] As an optional example, in the method of this embodiment, when the ordered data generated by multi-way merging exceeds the cache size of the shared cache, the ordered data exceeding the cache size of the shared cache is written to the external memory in blocks, and an external memory usage flag is set for the shared cache. For example, after the producer thread is started, the original multi-way merge sorting work of creating an index in parallel is executed, but the generated ordered data no longer directly generates index data, but is written to the shared cache; if the shared cache has reached the capacity limit, the generated ordered data is written to the external memory of the shared cache in blocks, and the shared cache is marked as using the external memory. In actual applications, when the producer thread has processed the data of all sorted segments, the producer thread ends.

[0048] Step S204: read the ordered data from the shared cache through the main thread, create an index tuple according to the read ordered data, and write the created index tuple into the index table.

[0049] In this embodiment, after starting the producer thread, the main thread for creating the index in parallel is converted into a consumer thread, which is responsible for reading the ordered data output by the producer from the shared cache, generating index data, and writing it into the index table.

[0050] As an optional example, when the ordered data in the shared cache has been read by the main thread and the shared cache is set with an external memory usage flag, the ordered data in the external memory is loaded into the shared cache in blocks, the ordered data is read from the shared cache by the main thread, and an index tuple is created based on the read ordered data.

[0051] As an optional example, when the ordered data in the shared cache and external memory have been read by the main thread, the producer thread waits for the producer thread to continue writing ordered data to the shared cache, reads the ordered data from the shared cache through the main thread, and creates an index tuple based on the read ordered data.

[0052] As an optional example, when the ordered data in the shared cache and external memory have been read by the main thread, the producer thread no longer continues to write ordered data to the shared cache, and reads the ordered data from the shared cache through the main thread, creates an index tuple based on the read ordered data, and then executes the index creation cleanup process. For example, release the child parallel thread resources, shared cache resources, close the underlying storage, and send a notification to the upper-level application that the index has been completed.

[0053] The method and system for improving the performance of parallel creation of btree indexes in this embodiment introduces a producer-consumer mechanism in the final merging stage of parallel creation of btree indexes in the database, and the producer and consumer use different threads; the producer thread is responsible for multi-way merging of the sorted segments generated in parallel, and writes the output ordered data into a shared cache, while the consumer obtains the merged data from the shared cache, generates index data, and writes it into the index table. That is, the final merging stage of parallel creation of indexes in the database is improved from the original single thread to a producer-consumer method, and the merge sorting and index data generation are parallelized to improve the performance of the final merging. It can maintain the performance gains of scanning and sorting brought about by the increase in parallelism, while reducing the performance degradation brought about by the increase in parallelism in the final merging stage.

[0054] The method and system for improving the performance of parallel creation of btree indexes in this embodiment are applicable to various databases that need to create indexes in parallel, such as openGauss database. According to engineering practice, in the final merging stage of parallel creation of indexes in many business scenarios, the time consumption of multi-way merge sorting and index data generation reaches 1:2 or even 1:1, and the method of this embodiment can effectively improve the performance of parallel creation of indexes.

[0055] When the method of this embodiment is applied to the openGauss database, the final merging stage of the original parallel index creation is split into two parallel tasks. The producer is responsible for the original multi-way merge sorting, and the consumer is responsible for the original generation of index data and writing it into the index table. Only the producer-consumer framework needs to be implemented, and most of the logic can effectively utilize the existing logic in the openGauss database, reducing a lot of development work.

[0056] like Figure 3 As shown, the present invention also provides a device, including a processor 310, a communication interface 320, a memory 330 for storing a computer program executable by the processor, and a communication bus 340. The processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 implements the above-mentioned method for improving the performance of parallel creation of btree indexes by running the executable computer program.

[0057] Among them, the computer program in the memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0058] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected based on actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0059] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0060] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention 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.

Claims

1. A method to improve the performance of creating btree indexes in parallel. It is characterized in that The method comprises: Use parallel subthreads to scan and sort data in parallel to generate multi-way sorting segments; When the parallel child threads finish parallel scanning and sorting of data, they create a shared cache through the main thread and start the producer thread; The generated multi-way sorted segments are multi-way merged by the started producer thread, and the ordered data generated by the multi-way merge is written into the shared cache; The main thread reads ordered data from the shared cache, creates index tuples based on the read ordered data, and writes the created index tuples into the index table.

2. The method for improving the performance of parallel creation of btree indexes according to claim 1, It is characterized in that The method uses parallel sub-threads to scan and sort data in parallel to generate multi-way sorting segments, including: using parallel sub-threads to scan data in parallel, sorting the data obtained by the parallel scanning, and generating multi-way sorting segments.

3. The method for improving the performance of parallel creation of btree indexes according to claim 1, It is characterized in that When the parallel sub-threads finish the parallel scanning and sorting of the data, a shared cache is created through the main thread and the producer thread is started, including: monitoring through the main thread whether the parallel sub-threads finish the parallel scanning and sorting of the data, when monitoring that the parallel sub-threads finish the parallel scanning and sorting of the data, creating a shared cache through the main thread, starting the producer thread, and passing the address reference of the shared cache to the producer thread.

4. The method for improving the performance of parallel creation of btree indexes according to claim 1, It is characterized in that The generated multi-way sorting segments are multi-way merged by the started producer thread, and the ordered data generated by the multi-way merging is written into the shared cache, including: when the ordered data generated by the multi-way merging exceeds the cache size of the shared cache, the ordered data exceeding the cache size of the shared cache is written into the external memory in blocks, and an external memory usage flag is set for the shared cache.

5. The method for improving the performance of parallel creation of btree indexes according to claim 1, It is characterized in that Reading ordered data from a shared cache through a main thread, and creating an index tuple based on the read ordered data, including: when the ordered data in the shared cache has been read by the main thread and the shared cache is set with an external memory usage flag, loading the ordered data in the external memory into the shared cache in blocks, reading ordered data from the shared cache through the main thread, and creating an index tuple based on the read ordered data.

6. The method for improving the performance of parallel creation of btree indexes according to claim 1, It is characterized in that Reading ordered data from the shared cache through the main thread, and creating index tuples according to the read ordered data, including: when the ordered data in the shared cache and the external memory have been read by the main thread, waiting for the producer thread to continue writing ordered data to the shared cache, reading ordered data from the shared cache through the main thread, and creating index tuples according to the read ordered data.

7. The method for improving the performance of parallel creation of btree indexes according to claim 1, It is characterized in that The main thread reads ordered data from the shared cache, creates index tuples based on the read ordered data, and also includes: when the ordered data in the shared cache and the external memory have been read by the main thread, the producer thread no longer continues to write ordered data to the shared cache, reads ordered data from the shared cache through the main thread, creates index tuples based on the read ordered data, and executes the index creation and cleanup process.

8. The method for improving the performance of parallel creation of btree indexes according to claim 7, It is characterized in that After creating the index tuple based on the read ordered data, the index creation cleanup process is executed, including: releasing sub-parallel thread resources, sharing cache resources, closing the underlying storage, and sending a notification that the index has been completed to the upper-level application.

9. A system for improving the performance of creating btree indexes in parallel. It is characterized in that The system includes a promotion server, which is used to: use parallel sub-threads to perform parallel scanning on data, and generate multi-way sorting segments by sorting the scanned data; when the parallel sub-threads finish the parallel scanning and sorting of the data, create a shared cache through the main thread and start the producer thread; perform multi-way merging on the generated multi-way sorting ends through the started producer thread, and write the ordered data generated by the multi-way merging into the shared cache; The main thread reads ordered data from the shared cache, creates index tuples based on the read ordered data, and writes the created index tuples into the index table.

10. A computer device, It is characterized in that The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 8 when executing the program.