Partition splitting management method and apparatus adaptable to large object partition
By dividing the data table in the database into a primary table shard and an LOB shard, and sending a write stop request when a split instruction is received, the problem of excessively long write stop time in partitioning large object columns is solved, resulting in shorter write stop time and improved user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2026-03-12
AI Technical Summary
When partitioning a database, especially when partitioning large object columns, excessively long write pauses can lead to a poor user experience.
The database tables are divided into primary table shards and LOB shards. After receiving the split command, stop write requests are sent to the primary table shard and LOB shard respectively. After the unfinished data write commands are completed, the data is constructed and divided into multiple destination partitions, and the data write commands are executed on the destination partitions.
This shortens the write pause time during partition splitting and improves the user experience.
Smart Images

Figure CN2025119847_12032026_PF_FP_ABST
Abstract
Description
Partition splitting management method and device adaptive to large object partition TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the technical field of database, and in particular to a partition splitting management method and device adaptive to large object partition, electronic equipment and storage medium. BACKGROUND
[0002] Partition splitting of a database is an optimization strategy mainly used in database management systems (DBMS), especially in environments that support large-scale data processing and distributed storage systems. Partition splitting aims to solve performance problems caused by data growth by dividing large data sets into smaller, more manageable parts, thereby improving query performance and data management efficiency.
[0003] During the partition splitting process, the source partition stops serving externally, and the destination partition needs to wait for the execution of the unfinished write instruction on the source partition to provide external services by referencing the data on the disk of the source partition. This waiting time is the stop-write time. In related technologies, the stop-write time is relatively long, resulting in poor user experience. Especially when the partition with large object columns is split, the stop-write time is longer due to the large amount of data in each data row, and the user experience is worse. SUMMARY
[0004] Therefore, one or more embodiments of the present specification provide a partition splitting management method and device adaptive to large object partition, electronic equipment and storage medium.
[0005] To achieve the above object, one or more embodiments of the present specification provide technical solutions as follows:
[0006] According to a first aspect of one or more embodiments of the present specification, a database system is provided, the database system comprising a database; wherein:
[0007] The data table in the database is divided into at least one partition;
[0008] The at least one partition in the database comprises a main table shard and a large object (LOB) shard;
[0009] The main table shard comprises a primary key column and a LOB identifier column;
[0010] The LOB shard comprises a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column;
[0011] A data row in the main table shard corresponds to a plurality of data rows in the LOB shard, and is used to represent a LOB.
[0012] According to a second aspect of one or more embodiments of the present specification, a partition split management method adapted to large object partition is provided; wherein a data table in a database is divided into at least one partition; the method comprises:
[0013] receiving a split instruction for a source partition containing a LOB column, sending a stop-write request to a main table shard and a LOB shard in the source partition respectively, so that the main table shard and the LOB shard stop receiving data write instructions; wherein the main table shard includes a primary key column and a LOB identifier column, the LOB shard includes a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column, one data row in the main table shard corresponds to multiple data rows in the LOB shard, and is used to represent one LOB;
[0014] According to the split instruction, a plurality of target partitions are constructed, and the data in the source partition is divided into the plurality of target partitions;
[0015] If all the data in the source partition is completed, the source partition is deleted.
[0016] In one or more possible embodiments of the present specification, the data in the source partition is divided into the plurality of target partitions, comprising:
[0017] After waiting for the data write instruction execution of the main table shard and / or the LOB shard in the source partition to be completed after receiving the stop-write request, the data in the source partition is divided into the plurality of target partitions.
[0018] In one or more possible embodiments of the present specification, after waiting for the data write instruction execution of the main table shard and / or the LOB shard in the source partition to be completed after receiving the stop-write request, the data in the source partition is divided into the plurality of target partitions, comprising:
[0019] After waiting for the data write memory table indicated by the data write instruction of the main table shard and / or the LOB shard in the source partition to be completed after receiving the stop-write request, and the data write memory table is written to disk to form an ordered string table, the data in the source partition is divided into the plurality of target partitions.
[0020] In one or more possible embodiments of the present specification, during the process of dividing the data in the source partition into the plurality of target partitions, the method further comprises:
[0021] receiving a data write instruction for the source partition, sending the data write instruction to the corresponding target partition to execute the data write instruction on the corresponding target partition.
[0022] In one or more embodiments of the present specification, before receiving the split instruction for the source partition, the method further comprises:
[0023] receiving a data write instruction for the source partition, and executing the data write instruction on the source partition.
[0024] In one or more embodiments of the present specification, executing the data write instruction on the source partition and / or the destination partition comprises:
[0025] if the data write instruction is a data insertion instruction, inserting a corresponding plurality of data rows in the LOB shard after inserting a data row indicated by the data insertion instruction in the main table shard.
[0026] In one or more embodiments of the present specification, executing the data write instruction on the source partition and / or the destination partition comprises:
[0027] if the data write instruction is a data deletion instruction, inserting a corresponding deletion row in the main table shard after inserting a deletion row indicated by the data deletion instruction in the LOB shard.
[0028] In one or more embodiments of the present specification, executing the data write instruction on the source partition and / or the destination partition comprises:
[0029] if the data write instruction is a data update instruction, sequentially performing the following operations: inserting a deletion row indicated by the data update instruction in the LOB shard, inserting a corresponding deletion row in the main table shard, inserting a data row indicated by the data update instruction in the main table, and inserting a corresponding plurality of data rows in the LOB shard.
[0030] According to a third aspect of one or more embodiments of the present specification, a partition split management apparatus adapted to large object partition is provided; wherein a data table in a database is divided into at least one partition; the apparatus comprises:
[0031] a stop-write module configured to receive a split instruction for a source partition containing a large object (LOB) column, and send a stop-write request to a main table shard and a LOB shard in the source partition respectively, so that the main table shard and the LOB shard stop receiving data write instructions; wherein the main table shard comprises a primary key column and a LOB identifier column, the LOB shard comprises a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column, one row of data in the main table shard corresponds to a plurality of rows of data in the LOB shard, and is used to represent one LOB;
[0032] A partitioning module is used to construct multiple destination partitions according to the splitting instruction, and to divide the data in the source partition into the multiple destination partitions;
[0033] The deletion module is used to delete the source partition if all data within the source partition has been partitioned.
[0034] In one or more possible embodiments of this specification, when the partitioning module is used to partition data within the source partition to the plurality of destination partitions, it is used for:
[0035] After the data write instructions that were not completed when the write stop request was received are executed in the main table shard and / or LOB shard within the source partition, the data within the source partition is divided into the multiple destination partitions.
[0036] In one or more possible embodiments of this specification, the partitioning module is used to partition the data in the source partition to the plurality of destination partitions after the incomplete data write instructions of the main table shard and / or LOB shard within the source partition have been executed upon receiving the stop write request. The module is configured to:
[0037] After the data in the source partition that was not completed when the write stop request was received is written to the memory table and written to disk to form an ordered string table, the data in the source partition is divided into the multiple destination partitions.
[0038] In one or more possible embodiments of this specification, the apparatus further includes a writing module for:
[0039] If a data write instruction for the source partition is received during the process of dividing the data in the source partition into the multiple destination partitions, the data write instruction is sent to the corresponding destination partition so that the data write instruction is executed on the corresponding destination partition.
[0040] In one or more possible embodiments of this specification, the apparatus further includes a writing module for:
[0041] If a data write instruction for a source partition is received before a split instruction for the source partition is received, the data write instruction is executed on the source partition.
[0042] In one or more possible embodiments of this specification, the write module is configured to, when executing the data write instruction on the source partition and / or the destination partition, perform the following:
[0043] If the data write instruction is a data insert instruction, after inserting the data row indicated by the data insert instruction into the main table shard, insert the corresponding multiple data rows into the LOB shard.
[0044] In one or more embodiments of the present specification, the write module is configured to, when executing the data write instruction on the source partition and / or the destination partition, is configured to:
[0045] If the data write instruction is a data deletion instruction, inserting a corresponding deletion row in the main table shard after inserting the deletion row indicated by the data deletion instruction in the LOB shard.
[0046] In one or more embodiments of the present specification, the write module is configured to, when executing the data write instruction on the source partition and / or the destination partition, is configured to:
[0047] If the data write instruction is a data update instruction, sequentially performing the following operations: inserting a deletion row indicated by the data update instruction in the LOB shard, inserting a corresponding deletion row in the main table shard, inserting a data row indicated by the data update instruction in the main table, and inserting a plurality of corresponding data rows in the LOB shard.
[0048] According to a third aspect of one or more embodiments of the present specification, a computer program product is provided, comprising computer programs / instructions, which, when executed by a processor, implement the steps of the method of the first aspect.
[0049] According to a fourth aspect of one or more embodiments of the present specification, an electronic device is provided, comprising:
[0050] a processor;
[0051] a memory for storing processor-executable instructions;
[0052] wherein the processor implements the method of the first aspect by running the executable instructions.
[0053] According to a fifth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, having stored thereon computer instructions, which, when executed by a processor, implement the steps of the method of the first aspect.
[0054] The technical solutions provided by the embodiments of the present specification can include the following beneficial effects:
[0055] In the partition split management method for large object partition provided by the embodiment of the present specification, the source partition contains a LOB column, and the source partition is provided with a main table shard and a LOB shard, one data row in the main table shard corresponds to multiple data rows in the LOB shard, the main table shard includes a primary key column and a LOB identifier column, and the LOB shard includes a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column; and when receiving a split instruction for the source partition, the method sends a stop-write request to the main table shard and the LOB shard respectively, so as to stop receiving data write instructions. In this way, the granularity of the stop-write duration of the partition split can be controlled to the data row in the main table shard or the data row of the LOB shard. Compared with the related art in which the granularity of the stop-write duration is controlled to the data row of the partition, that is, the data row composed of one data row in the main table shard and multiple data rows corresponding to it in the LOB shard, the stop-write duration of the partition containing the LOB column during the partition split process can be shortened, thereby improving the user experience. BRIEF DESCRIPTION OF DRAWINGS
[0056] FIG. 1 is a structure diagram of a distributed database provided by an example embodiment.
[0057] FIG. 2 is a data architecture diagram of a partition containing a LOB column provided by an example embodiment.
[0058] FIG. 3 is a flowchart of a partition split management method for a large object partition provided by an example embodiment.
[0059] FIG. 4 is a structure diagram of a device provided by an example embodiment.
[0060] FIG. 5 is a block diagram of a partition split management apparatus for a large object partition provided by an example embodiment. DETAILED DESCRIPTION
[0061] The example embodiments will be described in detail herein, with examples shown in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following example embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Instead, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of the present specification, as detailed in the appended claims.
[0062] It should be noted that the steps of the respective methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the steps included in the methods thereof can be more or less than described in this specification. Furthermore, a single step described in this specification can be broken down into multiple steps for description in other embodiments; and multiple steps described in this specification can be combined into a single step for description in other embodiments.
[0063] In the database in the related art, a partition containing a large object (LOB) column contains a data table, which contains at least a primary key column, a LOB identifier column and a LOB address column. Since the LOB column is used to store files with large data volume such as documents, pictures, audio, video, etc., the data volume of the LOB column is much larger than that of the ordinary column; this also makes the partition containing the LOB column have a longer stop-write time when the partition is split, because if the partition is split and the partition is being written with a data row at the time of stop-write, and the data row has a long write time due to the large data volume of the LOB field of the data row.
[0064] Based on this, at least one embodiment of this specification provides a partition split management method suitable for large object partitions, which can shorten the stop-write time of the partition during the partition split of the partition containing the LOB column, thereby avoiding the long stop-write time in the process to affect the user experience.
[0065] The method can be applied to a distributed database based on the LSM-Tree storage engine as shown in FIG. 1.
[0066] First, the data architecture of the partition containing the LOB column in the database executing the partition split management method adapted to the large object partition is introduced in detail. Please refer to Figure 2, the data table in the database can be divided into at least one partition. The partition containing the LOB in the database is provided with at least a main table fragment (Tablet) and a LOB fragment (Tablet), wherein the main table fragment is used to store the primary key (rowkey) and the LOB identifier (lobid), and one LOB is split into multiple fragments, each fragment is overflowed to the LOB fragment as a data row in the LOB fragment to store the LOB identifier (lobid), the fragment sequence number (seq), the fragment length (len) and the fragment address (Block addr). Since the data rows on the LOB fragment are overflowed from the main table fragment, each data row on the main table fragment corresponds to multiple data rows on the LOB fragment; the corresponding data row on the main table fragment and the multiple data rows on the LOB fragment can be used to represent the same LOB. It should be understood that each LOB (i.e. each data row) in the main table fragment can be split into the same number of fragments, and the fragments obtained by splitting are overflowed to the LOB fragment for storage; or each LOB (i.e. each data row) in the main table fragment can be divided into fragments according to the same data length, i.e. every same data length is a fragment, and the remaining data less than the data length is also a fragment.
[0067] Please refer to Figure 3, which exemplarily shows the flow of the partition split management method adapted to the large object partition, including steps S301 to S303.
[0068] In step S301, a split instruction for a source partition containing a large object LOB column is received, and a stop-write request is sent to the main table fragment and the LOB fragment in the source partition respectively, so that the main table fragment and the LOB fragment stop receiving data write instructions; wherein the main table fragment includes a primary key column and a LOB identifier column, the LOB fragment includes a LOB identifier column, a fragment sequence number column, a fragment length column and a fragment address column, one data row in the main table fragment corresponds to multiple data rows in the LOB fragment, and is used to represent one LOB.
[0069] Exemplarily, after receiving the stop-write request, the main table fragment and the LOB fragment will continue to execute the unfinished data write instructions, i.e. write the data indicated by the unfinished data write instructions into the memory table (MemTable) and form the ordered string table (SSTable) on disk.
[0070] In step S302, a plurality of destination partitions are constructed according to the split instruction, and data in the source partition is divided into the plurality of destination partitions.
[0071] For example, if the split instruction indicates that the source partition is to be split into two destination partitions, two destination partitions are constructed in this step.
[0072] For example, data in the source partition can be divided into the plurality of destination partitions after the execution of the data write instruction of the main table shard and / or the LOB shard in the source partition that is not completed when the stop-write request is received is completed. That is, data in the source partition is divided into the plurality of destination partitions after the data write memory table indicated by the data write instruction of the main table shard and / or the LOB shard in the source partition that is not completed when the stop-write request is received is written into the ordered string table.
[0073] It should be understood that the time period for waiting for the execution of the data write instruction of the main table shard and / or the LOB shard in the source partition that is not completed when the stop-write request is received in the example can be regarded as the stop-write time period of the partition containing the LOB column. That is, the main table shard and the LOB shard in the partition containing the LOB column can start receiving data write instructions again after the execution of the data write instruction that is not completed when the stop-write request is received is completed. The time period for waiting for the data rows written by the data write instruction that is not completed to be written is much shorter than the time period for waiting for one data row in a data table containing a primary key column, a LOB identifier column and a LOB address column (i.e., a data table without overflow of the LOB to the LOB shard) to be written in the related art.
[0074] In step S303, if all data in the source partition is divided, the source partition is deleted.
[0075] The partition split management method provided in the embodiments of the present specification is adapted to large object partition, the source partition contains a LOB column, and a main table shard and a LOB shard are arranged in the source partition, one data row in the main table shard corresponds to a plurality of data rows in the LOB shard, the main table shard includes a primary key column and a LOB identifier column, and the LOB shard includes a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column; when receiving a split instruction for the source partition, the method sends a stop-write request to the main table shard and the LOB shard respectively, so that the stop-write request stops receiving data write instructions, so that the granularity of the stop-write duration of the partition split can be controlled to the data row in the main table shard or the data row of the LOB shard, and compared with the related art in which the granularity of the stop-write duration is controlled to the data row of the partition, that is, the data row composed of one data row in the main table shard and a plurality of data rows corresponding to the one data row in the LOB shard, the stop-write duration of the partition containing the LOB column during the partition split process can be shortened, thereby improving the user experience.
[0076] In some embodiments of the present disclosure, the method further comprises:
[0077] If a data write instruction for the source partition is received during the process of dividing the data in the source partition to the plurality of target partitions, the data write instruction is sent to the corresponding target partition to execute the data write instruction on the corresponding target partition; and / or,
[0078] If a data write instruction for the source partition is received before receiving the split instruction for the source partition, the data write instruction is executed on the source partition.
[0079] For example, when the data write instruction is executed on the source partition and / or the target partition in the present embodiment, if the data write instruction is a data insertion instruction, the corresponding plurality of data rows are inserted in the LOB shard after the data row indicated by the data insertion instruction is inserted in the main table shard.
[0080] For example, when the data write instruction is executed on the source partition and / or the target partition in the present embodiment, if the data write instruction is a data insertion instruction, the corresponding plurality of data rows are inserted in the LOB shard after the data row indicated by the data insertion instruction is inserted in the main table shard.
[0081] For example, when the data write instruction is executed on the source partition and / or the destination partition in the embodiment, if the data write instruction is a data deletion instruction, a corresponding deletion row is inserted in the main table shard after the deletion row indicated by the data deletion instruction is inserted in the LOB shard.
[0082] For example, when the data write instruction is executed on the source partition and / or the destination partition in the embodiment, if the data write instruction is a data update instruction, the following operations are sequentially executed: a deletion row indicated by the data update instruction is inserted in the LOB shard, a corresponding deletion row is inserted in the main table shard, a data row indicated by the data update instruction is inserted in the main table, and a plurality of corresponding data rows are inserted in the LOB shard.
[0083] The above three preferred examples respectively describe the sequence of executing the data write instruction in the partition containing the LOB column from the three scenarios of data insertion, data deletion, and data update. In any of the above three scenarios, the data row in the main table shard is written earlier than the corresponding data row in the LOB shard and deleted later than the corresponding data row in the LOB shard during the execution of the data write instruction. Thus, the data row in the LOB shard can query the corresponding primary key during the execution of the data write instruction, especially when the partition split occurs during the asynchronous processing of the data row in the main table shard and the corresponding data row in the LOB shard. After the stop-write ends, it is ensured that the data row in the LOB shard can find the corresponding primary key in the main table shard, so that the corresponding destination partition can be determined when the data row is divided from the source partition to the destination partition. Because the data range of each destination partition is defined by the primary key during the partition split, the data row in the LOB shard needs to determine the corresponding destination partition by the primary key in the corresponding data row in the main table shard when it is divided from the source partition to the destination partition.
[0084] Conversely, if the data write instruction is not executed in the sequence defined in the above three preferred examples, the data row in the LOB shard cannot determine the corresponding destination partition when it is divided from the source partition to the destination partition. For example, the partition containing the LOB column receives a data deletion instruction for a certain primary key, deletes the data row corresponding to the primary key in the main table shard, and then receives a partition split instruction before the data row corresponding to the primary key in the LOB shard is deleted. The main table shard and the LOB shard are stopped, and the data in the main table shard and the LOB shard is divided into the corresponding destination partition after the stop-write ends. However, when the data row corresponding to the primary key in the LOB shard is divided, it cannot determine the corresponding destination partition because the primary key cannot be confirmed.
[0085] Figure 4 is a schematic structural diagram of an apparatus according to an example embodiment. Referring to Figure 4, at the hardware level, the apparatus comprises a processor 402, an internal bus 404, a network interface 406, a memory 408, a non-volatile memory 410, and of course other hardware required for tasks. One or more embodiments of the present specification can be implemented in software, for example, by the processor 402 reading a corresponding computer program from the non-volatile memory 410 into the memory 408 and then running. Of course, in addition to the software implementation, one or more embodiments of the present specification do not exclude other implementations, such as logic devices or a combination of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0086] Referring to Figure 5, the partition splitting management apparatus adapted to large object partition can be applied to the apparatus shown in Figure 4 to implement the technical solutions of the present specification. In the apparatus, the data table in the database is divided into at least one partition; the partition splitting management apparatus adapted to large object partition can comprise:
[0087] A stop writing module 501 is configured to receive a splitting instruction for a source partition containing a large object (LOB) column, and send a stop writing request to a main table shard and a LOB shard in the source partition respectively, so as to stop the main table shard and the LOB shard from receiving data writing instructions; wherein the main table shard comprises a primary key column and a LOB identifier column, the LOB shard comprises a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column, one row of data in the main table shard corresponds to multiple rows of data in the LOB shard, and is used to represent one LOB;
[0088] A splitting module 502 is configured to construct a plurality of target partitions according to the splitting instruction, and divide data in the source partition into the plurality of target partitions.
[0089] A deleting module 503 is configured to delete the source partition if all data in the source partition is completed to be divided.
[0090] In one or more possible embodiments of the present specification, when the splitting module divides data in the source partition into the plurality of target partitions, the splitting module is configured to:
[0091] Wait for the data writing instructions in the main table shard and / or the LOB shard in the source partition to be completed after receiving the stop writing request, and then divide the data in the source partition into the plurality of target partitions.
[0092] In one or more embodiments of the present specification, the dividing module is configured to, when dividing the data in the source partition into the plurality of destination partitions after waiting for the execution of the data write instruction for the primary table shard and / or the LOB shard in the source partition that is not completed when the stop-write request is received, configured to:
[0093] waiting for the data write memory table indicated by the data write instruction for the primary table shard and / or the LOB shard in the source partition to form an ordered string table after the data write memory table is received and flushed, and dividing the data in the source partition into the plurality of destination partitions.
[0094] In one or more embodiments of the present specification, the apparatus further comprises a writing module configured to:
[0095] if a data write instruction for the source partition is received during the process of dividing the data in the source partition into the plurality of destination partitions, sending the data write instruction to the corresponding destination partition to execute the data write instruction on the corresponding destination partition.
[0096] In one or more embodiments of the present specification, the apparatus further comprises a writing module configured to:
[0097] if a data write instruction for the source partition is received before the split instruction for the source partition is received, executing the data write instruction on the source partition.
[0098] In one or more embodiments of the present specification, the writing module is configured to, when executing the data write instruction on the source partition and / or the destination partition, configured to:
[0099] if the data write instruction is a data insertion instruction, inserting a plurality of data rows corresponding to the data row indicated by the data insertion instruction in the LOB shard after inserting the data row in the primary table shard.
[0100] In one or more embodiments of the present specification, the writing module is configured to, when executing the data write instruction on the source partition and / or the destination partition, configured to:
[0101] if the data write instruction is a data deletion instruction, inserting a deletion row in the primary table shard after inserting the deletion row in the LOB shard.
[0102] In one or more embodiments of the present specification, the writing module is configured to, when executing the data write instruction on the source partition and / or the destination partition, configured to:
[0103] If the data write instruction is a data update instruction, the following operations are performed in sequence: inserting a delete row indicated by the data update instruction in the LOB shard, inserting a corresponding delete row in the master table shard, inserting a data row indicated by the data update instruction in the master table, and inserting a corresponding plurality of data rows in the LOB shard.
[0104] The systems, apparatuses, modules, or units illustrated by the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an e-mail device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0105] In a typical configuration, a computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0106] The memory can include non-persistent memory in computer readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or Flash memory. The memory is an example of computer readable media.
[0107] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented by any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, disk storage, quantum memory, graphene-based storage medium or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carriers.
[0108] It is also to be noted that the terms "comprising", "including", and "having" or variations thereof herein, are intended to be open-ended terms that specify the presence of the stated elements but do not preclude the presence of additional elements. It is also to be noted that the term "if' as used herein, encompasses the meanings of both "if' and "when," and that the term "including" as used herein, means "including, but not limited to."
[0109] The above description of certain implementations has been presented for the purposes of clarity and explanation. It is not intended to be exhaustive or to limit the scope of the disclosure to the precise form described. Other implementations can be directed to alternate or equivalent functional implementations of the devices, systems, apparatuses, infrastructure, methodologies or
[0110] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0111] The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present specification are information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0112] It should be understood that although the terms first, second, third, etc. can be employed in this specification to describe various information, these information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information of the same type. For example, a first information can also be referred to as a second information without departing from the scope of one or more embodiments of the present specification, and similarly, a second information can also be referred to as a first information. Depending on the context, the word "if' as used herein can be interpreted as "when" or "in response to determining" as used herein.
[0113] The above description is only the preferred embodiment of one or more embodiments of the specification, and is not used to limit one or more embodiments of the specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the specification should be included in the protection range of one or more embodiments of the specification.
Claims
1. A database system, comprising a database; wherein: a data table in the database is divided into at least one partition; at least one partition in the database comprises a main table shard and a large object (LOB) shard; the main table shard comprises a primary key column and a LOB identifier column; the LOB shard comprises a LOB identifier column, a fragment sequence number column, a fragment length column and a fragment address column; one data row in the main table shard corresponds to a plurality of data rows in the LOB shard, for representing one LOB.
2. A method for managing partition splitting adapted to large object partitioning; wherein, a data table in the database is divided into at least one partition; the method comprises: receiving a split instruction for a source partition containing a LOB column, sending a stop-write request to a main table shard and a LOB shard in the source partition respectively, so that the main table shard and the LOB shard stop receiving data write instructions; wherein the main table shard comprises a primary key column and a LOB identifier column, the LOB shard comprises a LOB identifier column, a fragment sequence number column, a fragment length column and a fragment address column, one data row in the main table shard corresponds to a plurality of data rows in the LOB shard, for representing one LOB; constructing a plurality of target partitions according to the split instruction, and dividing data in the source partition to the plurality of target partitions; if all data in the source partition is completed, deleting the source partition. 3.The partition split management method adapted to LOB partition according to claim 2, wherein the step of dividing data in the source partition to the plurality of target partitions comprises: waiting for the data write instructions not completed when the main table shard and / or the LOB shard in the source partition receive the stop-write request to be executed, and then dividing data in the source partition to the plurality of target partitions. 4.The partition split management method adapted to LOB partition according to claim 3, wherein the step of waiting for the data write instructions not completed when the main table shard and / or the LOB shard in the source partition receive the stop-write request to be executed, and then dividing data in the source partition to the plurality of target partitions comprises: waiting for the data write memory table indicated by the data write instructions not completed when the main table shard and / or the LOB shard in the source partition receive the stop-write request to be executed, and then dividing data in the source partition to the plurality of target partitions. 5.The partition split management method adapted to LOB partition according to claim 2, wherein during the step of dividing data in the source partition to the plurality of target partitions, the method further comprises: receiving a data write instruction for the source partition, and sending the data write instruction to a corresponding target partition to execute the data write instruction on the corresponding target partition. 6.The partition split management method adapted to LOB partition according to claim 2, wherein before receiving the split instruction for the source partition, the method further comprises: receiving a data write instruction for the source partition, and executing the data write instruction on the source partition.
7. The partition split management method adaptive to large object partitioning according to claim 5 or 6, wherein executing the data write instruction on the source partition and / or the destination partition comprises: if the data write instruction is a data insertion instruction, inserting a plurality of data rows corresponding to the data row indicated by the data insertion instruction in the LOB fragment after inserting the data row in the main table fragment.
8. The partition split management method adaptive to large object partitioning according to claim 5 or 6, wherein executing the data write instruction on the source partition and / or the destination partition comprises: if the data write instruction is a data deletion instruction, inserting a deletion row in the main table fragment after inserting the deletion row in the LOB fragment indicated by the data deletion instruction.
9. The partition split management method adaptive to large object partitioning according to claim 5 or 6, wherein executing the data write instruction on the source partition and / or the destination partition comprises: if the data write instruction is a data update instruction, sequentially performing the following operations: inserting a deletion row in the LOB fragment, inserting a corresponding deletion row in the main table fragment, inserting a data row in the main table, and inserting a plurality of data rows in the LOB fragment indicated by the data update instruction.
10. A partition split management apparatus adapted to large object partitioning; wherein, A data table in a database is divided into at least one partition; the apparatus comprises: a stop-write module configured to receive a split instruction for a source partition containing a large object (LOB) column, and send a stop-write request to a main table fragment and a LOB fragment in the source partition respectively, so that the main table fragment and the LOB fragment stop receiving data write instructions; wherein the main table fragment comprises a primary key column and a LOB identifier column, the LOB fragment comprises a LOB identifier column, a fragment serial number column, a fragment length column and a fragment address column, one row of data in the main table fragment corresponds to a plurality of rows of data in the LOB fragment, and is used to represent one LOB; a division module configured to construct a plurality of destination partitions according to the split instruction, and divide data in the source partition to the plurality of destination partitions; a deletion module configured to delete the source partition if all data in the source partition is divided.
11. A computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the method of any one of claims 2 to 9.
12. An electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method of any one of claims 2 to 9 by running the executable instructions.
13. A computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 2 to 9.
Citation Information
Patent Citations
Relational database organization for sharding
CN108351900A
Data processing method, device and equipment and computer readable storage medium
CN110704421A
Method, device and equipment for generating index entry of large object data block index
CN115577009A
Data synchronization method and device, computer equipment and storage medium
CN116955471A
Data fusion big table based on subdivision grid and construction method thereof
CN118520858A