Database large object duplicate removal processing method, storage medium and equipment
By decomposing large object deduplication tasks into subtasks and performing parallel processing, combined with object type strategy selection and historical records, the problem of low efficiency of large object deduplication in traditional methods is solved, and efficient deduplication and database stability are achieved. .
Patent Information
- Application Number
- CN202411048057.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-29
AI Technical Summary
When existing database systems process large objects, the traditional deduplication method is inefficient, resulting in a waste of storage space and performance degradation. An efficient method is needed to handle the deduplication task of large objects.
Decompose the large object deduplication task into multiple subtasks, accelerate the entire deduplication process through parallel processing, select an appropriate deduplication strategy based on the object type, and record each deduplication task information in the deduplication task history table of the database.
It improves the overall efficiency of large object deduplication tasks, reduces the impact on database performance, ensures the stable operation of the database, and provides historical reference and management convenience for deduplication tasks.
Smart Images

Figure CN118861111A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology, and in particular to a large object deduplication processing method, storage medium and device for a database. Background Art
[0002] Large Object is a special type of data in the database, mainly including Binary Large Object (BLOB) and Character Large Object / National Character Large Object (CLOB / NCLOB). BLOB is used to store binary large object data, such as images, audio files, videos or other non-text format data; CLOB and NCLOB are used to store large amounts of character data, suitable for storing long texts such as articles, reports or XML documents. The upper limit of the volume of a single data item of this type of data is very high, up to GB or even TB, and the volume varies greatly. The small amount of data can be as small as a few bytes or even empty.
[0003] In existing database systems, large objects may take up a lot of storage space. If the same large object data is stored in multiple records, the data will appear repeatedly in the database, resulting in a waste of storage space and performance degradation. This makes deduplication of large objects one of the important tasks of database management. However, traditional deduplication methods are inefficient when dealing with large objects, which will seriously affect the performance of the database, so there is still room for improvement. Summary of the invention
[0004] An object of the present invention is to decompose the large object deduplication task into multiple subtasks and accelerate the entire deduplication process through parallel processing.
[0005] Another object of the present invention is to select an appropriate deduplication strategy according to the object type to improve the overall efficiency of the large object deduplication task.
[0006] Another object of the present invention is to use a deduplication task history table to record each deduplication task information separately.
[0007] In particular, according to a first aspect of the present invention, the present invention provides a method for deduplicating large objects in a database, comprising:
[0008] Starting a large object deduplication task for a target data base table in the database, wherein the target data base table has at least one large object column;
[0009] Dividing the deduplication task into a plurality of subtasks according to the large object column or the column partition for the large object column, and forming a subtask queue;
[0010] Creating a subtask process group based on the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database;
[0011] The subtasks in the subtask queue are correspondingly assigned to the subtask processes of the subtask process group, and each of the subtask processes independently processes the subtasks assigned thereto.
[0012] Optionally, the step of enabling each subtask process to independently process the subtask assigned thereto includes:
[0013] Identify the object type of the large object, where the object type includes a small object stored out-of-line and a large object stored out-of-line, wherein the data size of the small object stored out-of-line is less than or equal to a preset threshold, the data size of the large object stored out-of-line is greater than the preset threshold, and the large object stored out-of-line is divided into multiple storage slices for storage;
[0014] De-duplicate the identified small objects stored outside the row.
[0015] Dedupe storage slices for identified large objects stored out-of-row.
[0016] Optionally, the step of overall deduplication of the identified small objects stored outside the row includes:
[0017] Calculating duplicate removal feature values of the small objects stored outside the row;
[0018] Group small objects with the same weight feature value;
[0019] Compare the small objects in each group;
[0020] Combines identical small objects into a single object.
[0021] Optionally, the step of deduplicating storage slices of the identified large object stored out-of-row includes:
[0022] Calculating deduplication feature values of storage slices of the large object stored out of row;
[0023] Group the stored slices with the same deduplication feature value;
[0024] Compare the stored slices in each group;
[0025] Merge identical storage slices into a single slice.
[0026] Optionally, after the step of enabling each subtask process to independently process the subtask assigned thereto, the method further includes:
[0027] Obtaining the completion status of all subtask processes;
[0028] When all the subtask processes are completed, it is reported that the large object deduplication task of the target data base table is completed.
[0029] Optionally, the step of creating a subtask process group based on the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database includes:
[0030] Obtaining the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database;
[0031] Determine whether the queue length of the subtask queue is greater than the parallelism parameter of the large object deduplication task configured in the database;
[0032] If yes, create a subtask process group whose number of subtask processes is equal to the parallelism parameter value of the large object deduplication task;
[0033] If not, create a subtask process group whose number of subtask processes is equal to the queue length value of the subtask queue.
[0034] Optionally, the method for deduplication of large objects in a database further includes:
[0035] The deduplication task history table of the database records each deduplication task information on each large object column or column partition. The deduplication task history table is a system table generated in the database and related to the large object column.
[0036] Optionally, the method for deduplication of large objects in a database further includes:
[0037] Check whether data update occurs during deduplication process;
[0038] If so, skip the updated object and continue deduplication.
[0039] According to a second aspect of the present invention, the present invention provides a machine-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, any of the above-mentioned large object deduplication processing methods for a database is implemented.
[0040] According to a third aspect of the present invention, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, it implements any one of the above-mentioned large object deduplication processing methods for the database.
[0041] The large object deduplication processing method of the database of the present invention, after starting the large object deduplication task, can divide the deduplication task into multiple subtasks according to the large object column or the column partition for the large object column, and form a subtask queue, then create a subtask process group based on the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured by the database, finally assign the subtasks in the subtask queue to the subtask process of the subtask process group accordingly, and make each subtask process independently process the subtask assigned to it. In this way, the large object deduplication task is decomposed into multiple small tasks, and the whole deduplication process is accelerated by parallel processing. This can not only improve processing efficiency, but also make better use of the resources of the database system. At the same time, through reasonable task division and scheduling, the influence of a single task on database performance can also be reduced, and the stable operation of the database is guaranteed.
[0042] Furthermore, the method for deduplicating large objects in the database of the present invention can identify the object type of large objects, including small objects stored outside the row and large objects stored outside the row, in the process of making each subtask process independently process the subtask assigned to it, and perform overall deduplication on the identified small objects stored outside the row, and perform deduplication on the storage slices of the identified large objects stored outside the row. In this way, each subtask process independently processes the subtask assigned to it, and selects an appropriate deduplication strategy according to the object type, which helps to improve the overall efficiency and performance of the large object deduplication task.
[0043] Furthermore, the large object deduplication processing method of the database of the present invention records the deduplication task information on each large object column or column partition through a deduplication task history table, which helps to track the execution of tasks, identify potential duplicate data problems, and provide historical references for future deduplication tasks. In addition, by recording the deduplication task information in the deduplication task history table, it is beneficial for administrators and developers to obtain a detailed view of the deduplication process and make better decisions.
[0044] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0046] Figure 1is a schematic diagram of a table structure in a data table having a large object column according to an embodiment of the present invention;
[0047] Figure 2 is a schematic diagram of a system table in a data table having a large object column according to an embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of an optional large object control block in a data table having a large object column according to an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of another optional large object control block in a data table having a large object column according to an embodiment of the present invention;
[0050] Figure 5 is a schematic diagram of an object and a storage slice table in a data table having a large object column according to an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of storing slices referencing each other in a data table with a large object column according to an embodiment of the present invention;
[0052] Figure 7 is a schematic diagram of the table structure of a temporary large object registration table according to an embodiment of the present invention;
[0053] Figure 8 is a flowchart of a method for deduplicating large objects in a database according to an embodiment of the present invention;
[0054] Fig. 9 is a flowchart of creating a subtask process group in a large object deduplication processing method for a database according to an embodiment of the present invention;
[0055] Fig.10 is a flowchart of overall deduplication of small objects in a method for deduplication of large objects in a database according to an embodiment of the present invention;
[0056] Fig.11 It is a flowchart of deduplicating large object storage slices in a large object deduplication processing method for a database according to an embodiment of the present invention;
[0057] Fig.12 A schematic diagram of a computer readable storage medium according to an embodiment of the present invention;
[0058] Fig.13 Schematic diagram of a computer device according to one embodiment of the present invention. DETAILED DESCRIPTION
[0059] It should be understood by those skilled in the art that the embodiments described below are only some embodiments of the present invention, rather than all embodiments of the present invention, and these embodiments are intended to explain the technical principles of the present invention, rather than to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should still fall within the protection scope of the present invention.
[0060] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.
[0061] The present embodiment provides a method for deduplication of large objects in a database. Before describing the embodiment of the present application in detail, the database in the present embodiment is first described in order to better understand the database environment on which the present embodiment relies. The database environment not only supports the storage and operation of large objects, but also provides sufficient flexibility to perform complex deduplication tasks.
[0062] The database of this embodiment is established with a data base table, which can be a user base table and is created according to a creation statement. The data base table has at least one large object column, and at least part of the large object data items in the large object column are divided into multiple storage slices for storage. The data items in the large object column can be BLOB, CLOB / NCLOB or other types of variable-length binary data, character data, external data, etc. The data base table can be a user base table and is created according to a creation statement. The number of large object columns can be set according to business requirements, for example, set to one column, two columns, or more columns.
[0063] In the large object mode preset by the database, each large object column or each partition of the large object column is provided with a storage management table space, each storage management table space stores the object and storage slice table corresponding to the large object column or the large object column partition, and the object and storage slice table are used to store the description information and data of the storage slice.
[0064] In one example, the step of establishing a data base table includes: obtaining a creation instruction and generating a data base table according to the creation instruction, generating a column object identifier for each large object column or each partition of the large object column in the data base table; and naming the object and storage slice table according to the column object identifier to obtain a storage table object identifier. The creation instruction may use, for example, SQL (Structured Query Language). Taking a simple case as an example, assuming that a user has established a business table user_biz_data, which contains two large object columns col_x and col_y (and other regular data columns col_a and col_b) and the user has not set partitions for the large object columns, the creation statement may be:
[0065]
[0066] KLOB can be a large object data type defined in the database of this embodiment, which includes three proprietary base types: KBLOB, KCLOB, and KNCLOB, which correspond to the traditional BLOB, CLOB, and NCLOB types respectively. In the database of this embodiment, the existing Domain type mechanism can be used to set KBLOB, KCLOB, and KNCLOB as one of the replaceable implementations behind BLOB, CLOB, and NCLOB. This means that when the user specifies to use BLOB, CLOB, or NCLOB type when creating a table or defining a column, the proprietary base type KBLOB, KCLOB, or KNCLOB of this embodiment can actually be selected as an alternative.
[0067] The user creates a business table (base table) called user_biz_data, which contains two large object columns col_x and col_y that are not partitioned. This solution will automatically generate UUIDs (Universally Unique Identifiers) for these two large object columns.
[0068] The large object mode preset by the database can be a dedicated mode (Schema) created in the database. In some embodiments, the large object mode can be named sys_klob_schema, which defines the organization and structure of the database. For each large object column and its column partition in the user base table, the database system can establish a set of tables and indexes in the above Schema to store and manage large objects. The object itself will be divided into small storage slices (Chunks) and stored in these tables. It should be noted that the large object column can be partitioned as needed, and the large object column partition can be considered as a part of the large object column. Each large object column partition has an object and storage slice table. In some embodiments, when partitioning is not required, each large object column has an object and storage slice table.
[0069] For example, the sys_klob_sch Schema can set up matching object and storage slice tables for two unpartitioned large object columns col_x and col_y, named tab_colx_uuid and tab_coly_uuid respectively. The object and storage slice tables tab_colx_uuid and tab_coly_uuid generate globally unique identifiers using randomly generated UUIDs respectively. The format of the globally unique identifier can be a combination of a prefix (for example, the tab_ prefix mentioned above) and a UUID to meet the naming requirements of the database object name. The object record in the object and storage slice table is the first storage slice record of the object. In this embodiment, UUID is used to identify a large object column or a large object column partition, and data tables, indexes, and sequences can generate their own names by combining their own prefixes with UUIDs.
[0070] The large object column metadata table preset in the database system table records the description information of the object and the storage slice table. To manage large objects, the database system establishes a set of dedicated system tables to store the correspondence between the large object columns in the user table and these database objects, as well as the unique storage parameters of the large object columns. The large object column metadata table can be named sys_klob_column, which is one of a set of system tables configured for large objects in the database system.
[0071] The large object column metadata table sys_klob_column can also record the object identifier of the base table (used to identify the data base table, which can be named rel_oid and used when searching for metadata of the data base table) and the identifier of the large object column (which can be the column number of the large object column in the base table, used to locate the position of the large object column, which can be named attr_no, and can be used with rel_oid to uniquely identify a table column of the database, and is used when searching for table column metadata). In addition, the description information of the object and storage slice table recorded in the large object column metadata table includes the storage table object identifier (which can be named tab_oid, i.e., the OID of the above object and storage slice table. In the case of no partitioning, each large object column has a corresponding tab_oid. If the large object column is partitioned, each large object column partition has a corresponding tab_oid).
[0072] In the data base table, a large object control block is used to replace the position of the corresponding large object data item. The large object control block records at least the description information of the large object data item and the data item object identifier. That is, in the final data base table, the position of the large object data item is a control block. The control block can be set to different data structures according to the size of the large object data, and at least includes the description information of the large object data item and the data item object identifier. The description information of the large object data item is used to describe the type, various flags, version, etc. of the large object data item. The data item object identifier is a globally unique fixed identifier of the object, which is a UUID type identifier that is randomly generated when the object is created and remains unchanged throughout the life cycle of the object.
[0073] A set of system tables specially configured for large objects in the database system may also include: storage parameter history table (which may be named sys_klob_store_params), deduplication task history table (which may be named sys_klob_dedup_tasks), and in addition, the system metadata table in the database system table (which may be named pg_attribute) also records other basic attributes of large object columns that are consistent with other regular data types.
[0074] In some embodiments, the storage parameter history table sys_klob_store_params preset in the database system table records the storage table object identifier tab_oid and storage parameters of the object and the storage slice table, and these storage parameters may include storage parameter version number, storage options, encryption parameters, task identifiers, etc. The data in the storage parameter history table sys_klob_store_params can be used when the storage options such as compression and encryption of large objects are modified or when existing data needs to be recreated.
[0075] In some embodiments, the deduplication task history table sys_klob_dedup_tasks preset in the database system table records the storage table object identifier tab_oid of the object and the storage slice table and the deduplication task information, wherein the deduplication task information includes the deduplication task sequence number and the deduplication task identifier, which is used to determine the execution status of the deduplication task.
[0076] The original system tables of the database system tables also store the metadata of the tables and indexes used for large object storage, which is basically consistent with the metadata records of other common data types and will not be elaborated here.
[0077] Each storage management tablespace also stores the primary key index of the object and storage slice table. The primary key index is used to search for large object data items and / or storage slices in the object and storage slice table; and the large object column metadata table also records the information of the primary key index. The primary key index can generally be hash indexed. The search efficiency is improved by establishing an index.
[0078] A reference column is also provided in the object and storage slice table. The reference column is used to record the reference relationship between the storage slice and other storage slices and / or the reference relationship between the large object data item and other large object data items. By utilizing these reference relationships, repeated storage of the same large object data item and / or storage slice can be avoided, saving storage space resources. Furthermore, each storage management table space can also store a reference column index of the object and storage slice table. The reference column index is used to query the reference relationship in the object and storage slice table; and the large object column metadata table also records the reference column index information. The storage efficiency of finding reference relationships is improved by establishing a reference column index.
[0079] Since rewriting data and deduplication of large objects when modifying storage options requires a lot of execution time, in order to minimize the impact on the user's daily business, the above operations are generally performed gradually in the background. In order to ensure the correct execution of the above operations, in some embodiments, a data rewriting task sequence (store_seq_<col / part uuid> ) and the deduplication task sequence (dedup_seq_<col / part uuid> ). The data rewriting task sequence is used to record the rewriting process of objects and storage slice tables, and the deduplication task sequence is used to record the deduplication process of objects and storage slice tables, so that these two sequences can be used to track the tasks of rewriting data and deduplication of large objects when modifying storage options.
[0080] In this embodiment, in order to achieve efficient storage and management of large objects, especially when processing TB-level large objects, a storage environment design based on tables and indexes is adopted. This method avoids complex transformation of the underlying storage implementation mechanism of the database, and instead sets a storage management table space for each large object column or each large object column partition in the large object mode preset in the database.
[0081] The following is an example of creating a business table user_biz_data that contains two large object columns col_x and col_y. Figure 1 The diagram is a schematic diagram of a table structure in a data table with a large object column according to an embodiment of the present invention.
[0082] When the user creates the data base table (business table) user_biz_data, the database system generates UUIDs (colx_uuid and colly_uuid) for the col_x and col_y large object columns contained in it. When generating database objects, prefixes are added to the corresponding UUIDs. On the one hand, some UUID text forms have a number as the first character, which does not conform to the database object naming rules; on the other hand, a group of database objects, including tables, indexes, and sequences, are used to store a large object column or column partition. Sequences are indeed objects used to generate auto-increment sequence values in the database, and are usually used to provide unique identifiers for records in a table. In this solution, sequence numbers are generated for rewrite tasks and deduplication tasks respectively, the main purpose of which is to identify the execution order of these tasks. Since these sequence numbers are generated within a specific column or column partition range, and considering that the number of executions of these two types of tasks is usually not too many, the possibility of sequence value wrapping (i.e., the sequence value restarts after reaching the upper limit) is indeed very small. This ensures that the sequence numbers are unique within these ranges. In addition, these sequence numbers are not globally unique identifiers like UUIDs. UUID is usually used to generate globally unique identifiers. No matter where it is generated, the probability of conflict of UUID is very low. Sequence-generated unique identifiers are only valid in a specific context or range, and may no longer be unique beyond this range. If col_x and col_y are partitioned, each partition has its own UUID. In addition, regular data type columns col_a and col_b are stored according to the original storage logic.
[0083] The structure of the entire database includes: system metadata schema pg_catalog schema, application schema schema, and large object schema sys_klob_schema. The system metadata schema pg_catalog schema is the database metadata, and the application schema schema and large object schema sys_klob_schema are mainly user business data.
[0084] In the system tables, the relational attribute table (or system metadata table, which can be named pg_attribute) is used to store the common basic attributes of the database's general data types and data tables (including the basic attributes of large object columns that are consistent with other regular data types), the large object column metadata table sys_klob_column, the storage parameter history table sys_klob_store_params, and the deduplication task history table sys_klob_dedup_tasks as the unique storage attributes of big data. The large object column metadata table sys_klob_column records the OID of the created table and index, as well as the unique storage attributes of the large object column. The base table OID (rel_oid) and large object column number (attr_no) fields in the table are used to associate with the original system tables in the database, indicating which column in which data base table this row of data records the attributes of.
[0085] In order to track the execution status of long-term tasks such as deduplication tasks and rewriting existing data when modifying large object column storage options, and to ensure recovery from interrupted tasks, the storage parameter history table sys_klob_store_params and the deduplication task history table sys_klob_dedup_tasks are used to record the history of storage parameters and deduplication task parameters.
[0086] The large object schema sys_klob_schema includes col_x data storage tablespace and col_x data storage tablespace. If the large object column has partitions, each partition has its own data storage tablespace. Taking col_x data storage tablespace as an example, in addition to data storage of col_x objects and storage slice tables, indexes (which can be hash indexes) are also created for the primary key and reference columns of the objects and storage slice tables.<colx_uuid> ,ref_<colx_uuid> .
[0087] col_x object and storage slice tables can be named with the prefix tab_ plus colx_uuid to store object records and storage slice records. Both are globally uniquely identified by a randomly generated UUID. The object record is essentially the first storage slice (Chunk) record (Chunk) of the object.<colx_uuid> Primary key index idx_<colx_uuid> It can be used to quickly find objects or store slices of Chunks. When object deduplication is supported, objects are allowed to reference other objects and Chunks to reference other Chunks.<colx_uuid> Reference column index ref_<colx_uuid> It can be used to speed up the query operation of reference relationship.
[0088] In the base table user_biz_data, the location of the large object data item will be replaced by the large object control block, which will contain the actual storage location of the large object data item. In some embodiments, if the data size of the large object data item is very small, in order to optimize performance, the data item with small data size can also be directly stored in the large object control block according to the user's choice.
[0089] Figure 2 This is a schematic diagram of a system table in a data table with a large object column according to an embodiment of the present invention. There are four main system tables related to large object columns: large object column metadata table sys_klob_column, relationship attribute table pg_attribute, storage parameter history table sys_klob_store_params, and large object column deduplication task history table sys_klob_dedup_tasks.
[0090] The relation attribute table pg_attribute is used to record table column metadata. Like other columns of regular data types, the basic attributes of large object columns are also stored in this table. The data base table OID rel_oid and the column number attr_no of the large object column in the base table can be used to locate the position of the large object column in the data base table.
[0091] The large object column metadata table sys_klob_column is used to store the unique attributes of the large object column and its column partitions. It is associated with the relational attribute table pg_attribute through the two fields: the data base table OID rel_oid and the column number attr_no of the large object column in the base table. If the large object column is not partitioned, each record in the relational attribute table pg_attribute has a corresponding record in the large object column metadata table sys_klob_column. If the large object column is partitioned, each partition will also have a corresponding record in the large object column metadata table sys_klob_column.
[0092] Specifically, the large object column metadata table sys_klob_column can include the following attributes:
[0093] The data base table OID rel_oid is used when searching for metadata related to the base table.
[0094] The column number attr_no of the large object column in the base table can be used with rel_oid to uniquely identify a table column in the database and is used when looking up table column metadata.
[0095] Object and storage slice table OID tab_oid, used to store the OID of the large object and its storage slice table. If the large object column is not partitioned, each large object column corresponds to such a table. If the large object column is partitioned, each partition also corresponds to such a table.
[0096] Primary key index OID idx_<colx_uuid> , the OID of the index (which can be a hash index) of the primary key column unit_id of the object and storage slice table. When the large object column is not partitioned, each large object column corresponds to a primary key index. When the large object column is partitioned, each partition also corresponds to such an index.
[0097] Reference column index OID ref_<colx_uuid> : The OID of the index (hash index) of the object / storage slice identification column ref_id used in the object and storage slice table. If the big object column is not partitioned, each big object column corresponds to such an index. If the big object column is partitioned, each partition also corresponds to such an index.
[0098] The tablespace OID tbs_oid is the OID of the tablespace where the object and the slice table and its index are located. Large object columns can be placed in different tablespaces from other data, or each column partition can be placed in a different tablespace. If needed, a separate tablespace can be specified for each large object column (unpartitioned) or large object column partition (partitioned).
[0099] The storage parameter version number sequence OID store_seq_oid is the storage parameter version number sequence store_seq_<col / part uuid> The OID of the store_seq_ sequence is used to generate integers that identify the versions of the large object storage parameters and their order. Each large object column (in the case of non-partitioning) or large object column partition (in the case of partitioning) corresponds to such a sequence object.
[0100] The deduplication task sequence OID dedup_seq_oid is the deduplication task sequence dedup_seq_oid for the large object column or large object column partition.<col / part uuid> The OID of the deduplication task sequence dedup_seq is used to generate an integer to identify the version of the large object deduplication task parameters and their order. Each large object column (in the case of no partition) or large object column partition (in the case of partition) corresponds to such a sequence object.
[0101] The physical size of the storage slice chunk, chunk_size, is used to record the size of the storage slice Chunk of the large object. The unit is bytes. The Chunk size is not limited by the size of the underlying storage page and can be selected between 2K and 1G. The Chunk size is set separately for each large object column (unpartitioned) or large object column partition (partitioned) to meet the requirements of different large data columns.
[0102] The current storage option lob flags is the current storage option. This can be a 32-bit bit string, which contains storage options such as storage location, compression, and encryption. The storage parameter history table sys_klob_store_params also fully records the storage options of each version. In order to speed up some operations, the current storage option lob flags retains a redundant field and is stored repeatedly;
[0103] The current storage parameter version number store ver is the latest serial number generated by the large object column / partition storage parameter version number sequence. It is used together with tab_oid to identify which record in the system table sys_klob_store_params the current storage parameter corresponds to.
[0104] dedup_ord: current deduplication task number, which is the latest serial number generated by the large object column or large object column partition deduplication task serial number sequence. It is used together with tab_oid to identify which record in the large object column deduplication task history table sys_klob_dedup_tasks the current deduplication task corresponds to.
[0105] Partition strategy partstrat, used to record the partition strategy. The partition strategy can include h hash partition, l list partition, r range partition table. This attribute has a value only in the row corresponding to the object and the storage slice partition table;
[0106] The number of columns in the partition key, partnatts; only has values in the row corresponding to the object and the Chunk partition table;
[0107] Default partition partdefid: The OID of the pg_class entry for the default partition of this partitioned table, or zero if this partitioned table has no default partition. This value is present only in rows corresponding to objects in Chunk partitioned tables;
[0108] The partition key column number vector partattrs is an array of length partnatts values indicating which table columns are part of the partition key. For example, the value 1 3 indicates that the first and third table columns form the partition key. A zero in this array indicates that the corresponding partition key column is an expression rather than a simple column reference, and is only present in the row corresponding to the object and the storage slice partition table;
[0109] Partition key operator class OID vector partclass. For each column in the partition key, this field contains the OID of the operator class to use. It has a value only in the row corresponding to the object and the storage slice partition table.
[0110] Partition key column collation OID vector partcollation. For each column in the partition key, this field contains the OID of the collation to be used for partitioning. If the column is not a sortable data type, the corresponding value is zero. It only has a value in the row corresponding to the object and the storage slice partition table.
[0111] Partition key column expression tree partexprs, expression tree of partition key columns that are not simple column references (expressed in nodeToString()), which is a list with one element for each zero item in partattrs. If all partition key columns are simple column references, this field is empty. There is a value only in the row corresponding to the object and the Chunk partition table;
[0112] The internal representation of a single partition boundary, relpartbound, is the internal representation of the partition boundary and has values only in the rows corresponding to the column partition.
[0113] The large object column-specific storage parameter history table sys_klob_store_params is used to save all historical versions of each large object column-specific storage parameter in the database library, and is associated with the records in the sys_klob_column table through the tab_oid column. These historical data are used when modifying the compression, encryption and other storage options of large objects and need to rewrite existing data.
[0114] Specifically, the large object column-specific storage parameter history table sys_klob_store_params can include the following attributes:
[0115] Object and storage slice table OID tab_oid;
[0116] The storage parameter version number store_ver is defined by the aforementioned tab_oid as store_seq_<col / part uuid> The sequence generation;
[0117] The storage option lob flags can be used to identify the off-line storage method (including table storage method, file storage method, OSS (Object Storage Service) storage method, etc.), whether in-line storage is available (available or unavailable), whether encryption is available (encrypted or not), the compression level (not compressed, low-level compression, medium-level compression, high-level compression), and the encryption algorithm identifier (encryption algorithm type). The contents of the above identifiers occupy one or more identification bits of the storage option lob flags. In some embodiments, the storage option lob flags can be a 32-bit bit string, which is spliced by the above identification bits.
[0118] Key expiration UTC time key_expr, the expiration time of the key used to encrypt the large object column, can be in UTC time (Coordinated Universal Time);
[0119] The key enc_key is the key for encrypting large object columns. It is stored in ciphertext and encrypted with the parent key.
[0120] The encryption & compression task identifier enc_task_id is the identifier of the large object column encryption and compression task. It can be an identifier in the form of a UUID, which is randomly generated when creating a large object column encryption and compression task and registered in a hash table in the memory. If the identifier recorded in the table cannot be found in the encryption and compression task registration table in the current memory, it means that the process executing this encryption and compression task has exited.
[0121] The tab_oid and store_ver fields in the large object column-specific storage parameter history table sys_klob_store_params can be combined to uniquely identify a storage parameter version of a large object column or large object column partition in a library.
[0122] The large object column deduplication task history table sys_klob_dedup_tasks saves the parameters of each deduplication task for each large object column in the database. It is associated with the records in the sys_klob_column table through the tab_oid column to determine the execution status of the deduplication task.
[0123] Specifically, the large object dedup task history table sys_klob_dedup_tasks can include the following attributes:
[0124] Object and storage slice table OID tab_oid, meaning is the same as the tab_oid attribute of other system tables above;
[0125] The deduplication task sequence number dedup_ord is composed of the object and storage slice table OID as the large object column or large object column partition deduplication task sequence dedup_seq_<col / part uuid> The sequence generation;
[0126] The unique identifier of the deduplication task process group, dedup_task_id, is a UUID format identifier, which is randomly generated when creating a large object column deduplication task and registered in a hash table in memory. If the identifier recorded in the table cannot be found in the deduplication task registration table in the current memory, it means that the process executing this deduplication task has exited.
[0127] The dedicated system tables established above record the description information of the object and the storage slice table. These dedicated system tables are used to store the correspondence between the large object columns in the user table and the database objects used to store large objects, as well as the unique storage parameters of the large object columns, making data management more efficient and in line with the storage management characteristics of large objects.
[0128] In the solution of this embodiment, a large object control block is used to replace the position of the corresponding large object data item in the data base table. The large object control block can include two types: an in-row large object storage structure and an out-of-row large object storage structure.
[0129] Figure 3 The diagram is a schematic diagram of an optional large object control block in a data table having a large object column according to an embodiment of the present invention. Figure 3 The out-of-row large object storage structure is shown. The large object control block varattrib_4b includes a file header varattrib_4b.va_header and data varattrib_4b.va_data. The data varattrib_4b.va_data includes the description information of the large object data item (LOB object control block description word) and the data item object identifier (LOB object fixed unique identifier).
[0130] The description information of the large object data item may describe the control block type (inline or outline), flags such as whether there is data in the line, control block format version number, etc. The above contents may respectively occupy one or more flags of the description information. In some embodiments, the description information of the large object data item may be a 32-bit bit string, which is formed by concatenating the flags corresponding to the above descriptions.
[0131] The data item object identifier is a UUID type identifier that is randomly generated when the object is created and remains unchanged throughout the life cycle of the object.
[0132] The out-of-row large object storage structure only contains the LOB object control block descriptor and the LOB object fixed unique identifier. These two fields remain unchanged throughout the life cycle of the object, avoiding the need to update the data base table when updating the large object content.
[0133] Figure 4 The diagram is a schematic diagram of another optional large object control block in a data table having a large object column according to an embodiment of the present invention. Figure 4 The in-line large object storage structure is shown.
[0134] The in-row large object storage structure is for large object data items with a small amount of data (e.g., within 32k). It stores large object data in the control block (the maximum size of the large object data is within a set range, e.g., a maximum of 32k). In addition to the LOB object control block descriptor and the LOB object fixed unique identifier, the data varattrib_4b.va_data further includes: LOB object storage options and LOB data. The LOB object storage option can be a bit string, which can use the same format as the lob_flags field in the system table sys_klob_column and sys_klob_store_params. LOB data contains the data of the large object.
[0135] By distinguishing between the in-row large object storage structure and the out-of-row large object storage structure, the storage requirements of large object data items of different data sizes are met, and only data exceeding a certain data size (for example, 32k) is stored out-of-row.
[0136] The object and storage slice table is a table that actually stores large object data. During database operation, each large object column or column partition is equipped with an object and storage slice table. This embodiment optimizes and improves the object and storage slice table, which is significantly different from the existing PostgreSQL and has obvious advantages.
[0137] In the PostgreSQL database solution, the large object storage table pg_largeobject is a system table that is only used to store slice data. It contains three fields: loid, pageno, and data. Among them, loid is the unique identifier of the large object, the type is OID (4-byte unsigned integer), and it is unique within the database. Pageno identifies the page number of the chunk data in the large object (starting from 0), and the type is a 4-byte integer. Data is the chunk data, and the volume does not exceed 1 / 4 of the database storage page size. For the common 8K storage page setting, its size does not exceed 2K.
[0138] In the PostgreSQL database, the total capacity of large objects in the entire database is limited by the upper limit of the data volume of a single table, and the total number of objects in the entire database is limited by the range of OID values. If the user's business table uses data types with a larger value range, such as int8, the number of large object identifiers may not be enough. Moreover, this type of OID identifier can only ensure uniqueness within a database. If you want to import a large object into another database, you must reallocate the identifier, which is not conducive to tracking large objects. Each row of a large data object stores the data of a page of a large object, starting from the byte offset (pageno*LOBLKSIZE) inside the object. Sparse storage is allowed, and pages may be lost and may be shorter than LOBLKSIZE bytes (even if it is not the last page). A lost area in a large object will be read as 0. In other words, this solution does not support insertion or deletion operations in the middle of a large object, but only supports content appending and replacement. Its behavior mode is different from the generally understood editing operation.
[0139] Figure 5 : This is a schematic diagram of an object and storage slice table in a data table with a large object column according to an embodiment of the present invention. In the scheme of this embodiment, there are two types of records stored in the object and storage slice table. The first type is an object record, which contains object metadata and data within the first 32K (for example, it can be set to other values), which is used to accelerate the operation of some functions. For objects larger than 32K (for example, it can be set to other values), it also contains a storage slice index block, which is used to find out which storage slices the data read and written by the user is located in. The second type is a storage slice record, which contains storage slice metadata and data above 32K. A large object (more than 32K) will consist of an object record and several storage slice records. For each large object column or column partition, the size of the storage slice can be freely selected within 1G. If the average size of the objects in the column is small, it is suitable to use a smaller storage slice data size; if the average size of the objects in the column is large, it is suitable to use a larger storage slice size. For example, for TB-level large objects, the largest storage slice size (1GB) can be used.
[0140] Specifically, the object and storage slice table can include the following attributes:
[0141] The object's fixed unique identifier, uint_id, is a UUID-type unique identifier. For object records, this is the object identifier, and for storage slices, this is the storage slice identifier. UUID-type identifiers can be considered unique in any case. Even if an object is imported into other databases, this identifier can remain unchanged and no conflict will occur.
[0142] part_key is the partition key used internally by the system and can be a signed integer. When the user chooses to use other columns in the base table as the partition key of the large object column, the original partition setting made by the user will be translated into an internal list partition format. This field contains the partition key used internally. When the user chooses to perform Hash partitioning based on the object / storage slice identifier, this field can be NULL.
[0143] store_ver is the storage parameter version number of the object. It is NULL in the storage slice record. This field can also be used to distinguish object records from storage slice records.
[0144] ref_id, for object records, if there is a value, it is the identifier (UUID) of the referenced object, indicating that the object is exactly the same as the referenced object; for storage slice records, if there is a value in this field, it is the identifier (UUID) of the referenced storage slice, indicating that the storage slice is exactly the same as another storage slice. When this field is not NULL, the prefetch and ext_data fields of the record are both NULL. In addition, only when one object is exactly the same as another object, can there be a reference relationship between the two. If only some storage slices are the same, there is only a reference relationship between the storage slices, and there is no reference relationship between the objects.
[0145] ref_count, in the object record, represents the number of times this object is referenced by other objects; in the storage slice record, represents the number of times this storage slice is referenced by other storage slices. If the object or storage slice is not referenced, the value of this field is 0.
[0146] dedup_feat is the deduplication feature value of the storage slice itself in the storage slice record, and the deduplication feature value of the entire object in the object record. This is a binary data block, and its length is determined by the deduplication feature value algorithm. If the deduplication function has never been enabled on the corresponding column or column partition, this field is NULL (initial state). For small objects stored out of row, if DML operations change the object content, then when the DML operation occurs: 1. If deduplication is not currently enabled, set this field to NULL; 2. If deduplication is currently enabled, generate a new object feature value and fill it in this field; for large objects stored out of row, if DML operations change the content of its subordinate slices, then when the DML operation occurs: 1. If deduplication is not currently enabled, set this field to NULL; 2. If deduplication is currently enabled, generate a new slice feature value and fill it in this field. When the deduplication task is executed, feature values will be generated for small objects that do not have feature values and slices of large objects, and filled in this field.
[0147] prefetch, in the object record, is the data within the first 32K of the object, which is stored according to the object storage parameter settings and may be compressed and encrypted; in the storage slice record, this field is always NULL.
[0148] ext_data, in the object record, this additional data field contains the storage slice index block, records the arrangement order of all storage slices of the object, the original data logical length and unique identifier. The logical length here refers to the length calculated in the unit of the original data. For BLOB, the unit is bytes, and for CLOB / NCLOB, the unit is characters. In the storage slice record, this field contains the data of the part above 32K of the large object. Both the storage slice index block and the storage slice data will be stored according to the setting of the object storage parameters, and may be compressed and encrypted. For example, in the record of the first storage slice of a large object, the additional data field can be used to store the index records of all storage slices corresponding to the large object, that is, the storage slice index block. In the storage slices other than the first storage slice of the large object, the additional data field is used to store the data of the corresponding storage slice. That is, only the first storage slice of the large object is used to store the storage slice index block in the additional data field, and its own data is stored in the prefetch field, and the remaining storage slices will store their own corresponding data content in the additional data field of ext_data. Whether storing slice index blocks or slice data, they will be stored according to the settings of the object storage parameters, and may be compressed and encrypted. Under the above storage structure, the storage slice content modification method of this solution is significantly different from the PostgreSQL database in the prior art. It can efficiently support insertion and deletion operations in the middle of large objects and adopt the same semantics as string insertion and deletion operations.
[0149] In the object record (i.e. the first data row of the object), the prefetch field is used to store the first slice of the object, i.e. the data of limited length in the object header. In some scenarios, this part of data can be directly read and written like a regular field without going through a file-based API; its length limit is also low, unlike subsequent slices which can be set to be very large; the ext_data field is used to store the slice index block. In the slice record (i.e. the data row where the second and subsequent slices are located), the prefetch field is not used and is set to NULL; the ext_data field is used to store the data content of the slice.
[0150] Through the above database design method, when a large object is split into multiple storage slices, first, the global unique identifier of the large object itself can be determined in the data base table (that is, the user_biz_data table), and the first storage slice where it is located can be found in the object and storage slice table according to the global unique identifier of the large object (the global unique identifier of the large object is the slice unique identifier of the first storage slice); then, the global unique identifier of the target storage slice where the target data is located is determined through the storage slice index block recorded in the first storage slice, and then the target storage slice is found in the object and storage slice table through the global unique identifier of the target storage slice, and finally the specific data of the target storage slice is obtained in its ext_data column.
[0151] In addition, if you want to modify the data of the target storage slice, you can also find the corresponding target storage slice and perform the operation according to the above method, and then synchronously update the content of the storage slice index block in the additional data field of the first storage slice.
[0152] The index block of the storage slice is a binary data block that contains the location information of all the storage slices of an object, which includes the following fields in sequence: storage slice index library format description word, storage slice number, storage slice length array, and storage slice identification array.
[0153] The storage slice index library format description word can be a signed integer, used as a bit string, some of its bits (such as the lower 8 bits) are the storage slice index block format version number, and the other bits can be reserved.
[0154] The total number of storage slices, that is, the length of the subsequent storage slice array, the type is a signed integer. If this field is 0, it means that no storage slice is included.
[0155] The length of the storage slice array is the total number of storage slices mentioned above. The array element type is a signed integer and is arranged in the order of the storage slices in the object.
[0156] Storage slice identifier array, the length is the total number of storage slices, the array element type is UUID number, and it is also arranged in the order of storage slices in the object.
[0157] from Figure 5 As can be seen in the figure, in the storage slice index block, the metadata (length and identifier) of the storage slice is not stored by row, but by column, that is, all storage slice length values are stored continuously first, and then all storage slice identifier values are stored continuously. Since large objects are usually updated less frequently, there will be many repeated values in the length value of their storage slices, which helps to improve the compression rate.
[0158] In the solution of this embodiment, the metadata (identification, length, etc.) of the storage slice is stored separately from the data, the actual length of the storage slice is variable, and the order of the storage slices in the large object is recorded by the storage slice index block. Therefore, when inserting or deleting data in the middle of the large object, only the storage slice involved in the inserted or deleted data needs to be rewritten, and other storage slices are not moved, which greatly reduces the amount of data that needs to be rewritten during the update and improves performance.
[0159] In comparison, the PostgreSQL database uses fixed-length storage slices, and the storage slice metadata and data are saved in one record. The position of the storage slice sequence number is used to indicate its position in the object. If data is inserted or deleted from the middle, all storage slices after the insertion / deletion point need to be rewritten, and the performance is far inferior to the solution of this embodiment.
[0160] By adding reference object / storage slice uint_id, ref_id, and ref_count, the large object storage of the solution of this embodiment supports deduplication operations, that is, simplifying duplicate objects or storage slices. Figure 6 It is a schematic diagram of storage slices referencing each other in a data table with a large object column according to an embodiment of the present invention. For example, some storage slices of a large object data item A are the same as storage slices in another large object data item B. These storage slices are relatively independent and have unique identifiers, but do not store actual data, but store the identifier of the storage slice of the object data item B. For example, when storage slice 102 is the same as storage slice 201, and storage slice 104 and storage slice 105 are the same as storage slice 204, the identifier of storage slice 201 is stored in storage slice 102, and storage slice 104 and storage slice 105 respectively store the identifier of storage slice 204. Storage slice 201 and storage slice 204 respectively record reference counts.
[0161] Similarly, if a large object data item D is the same as another large object data item C, then large object data item D can store the identifier of large object data item C without storing the data. Large object data item C records the reference count. Of course, this is only for large object data items with a volume of less than or equal to 32K. For larger large object data items, since the cost of determining whether they are duplicated as a whole is too high and the probability of a complete match is low, it is a better choice to only remove duplicates at the granularity of storage slices.
[0162] The reference count of the above records can avoid data errors when modifying data or executing DML.
[0163] Using the above storage structure, the storage forms of large objects can be divided into three types: small objects stored in-line, small objects stored out-of-line, and large objects stored out-of-line.
[0164] The metadata and data body of the small objects stored in the row are stored in the row of the data base table in the form of an in-row control block. The small objects stored in the row have a compact structure and occupy a small space.
[0165] Part of the metadata of small objects stored out of line is stored in the data base table row, and the remaining metadata and data body are stored in the object and storage slice table in the form of an out-of-line object control block and an object record. In addition to the control block and the object data itself, small objects stored out of line also contain fields that support other features such as partitioning, deduplication, and progressive background tasks.
[0166] Part of the metadata of a large object stored out-of-line is stored in-line, the remaining metadata, the first 32K data, and the storage slice index block are stored in one object record, and the data above 32K is stored in a group of storage slice records. A large object stored out-of-line consists of one object record and several storage slice records. The object record and several storage slice records are stored in the same table, using the same primary key column. The object record serves as the entry point to access the large object data.
[0167] It is worth noting that although large objects stored out-of-row also have fields that support partitioning, deduplication, and progressive background tasks, as well as other features of the above-mentioned small objects, the differences are: 1. In the object records of large objects, ref_id, ref_count, and dedup_feat are not used, because large objects are not deduplicated as a whole, but only slice-level deduplication; 2. In the slice records of large objects: store_ver is not used, because all contents of a single object use unified storage parameters, which is more in line with the general expectations of users; prefetch is also not used, because when users read and write specified fragments in large objects, they do not need to quickly obtain a small piece of data at the head of the slice.
[0168] In addition, during the operation of the database, it is sometimes necessary to create some temporary large objects, which do not belong to any user business table (data base table). To support this application scenario, after the session is started, the solution of this embodiment will create a temporary large object registration table and a temporary large object storage table in the temporary table space to store temporary large objects.
[0169] The temporary large object registration table, with the prefix tmp_ plus a randomly generated UUID as the table name, is used to organize and find all temporary large objects within the scope of the activity (Session), and is not partitioned. The temporary large object storage table is an object and storage slice table created to match the three large object columns in the temporary large object registration table, and is not partitioned.
[0170] Figure 7FIG. 4 is a schematic diagram of the table structure of a temporary large object registration table according to an embodiment of the present invention. Figure 7 As shown, the fields in the temporary large object registration table include:
[0171] lob_id: the identifier of the temporary large object, of type UUID;
[0172] lob_type: large object type OID, one of the three types of OIDs: BLOB, CLOB, and NCLOB;
[0173] blob_val: BLOB column. If the temporary large object is of BLOB type, this column has a value, otherwise it is NULL.
[0174] clob_val: CLOB column. If the temporary large object is of BLOB type, this column has a value, otherwise it is NULL.
[0175] nclob_val: NCLOB column. If the temporary large object is of BLOB type, this column has a value; otherwise, it is NULL.
[0176] In the solution of this embodiment, the temporary large object registration table plays the role of the user business table (data base table), and the processing logic of the temporary large object is basically the same as that of the persistent large object. The life cycle of the temporary large object is determined by the life cycle of the variable bound to it. At the latest at the end of the activity (Session), the temporary large object storage table will be deleted, so all temporary large objects in the activity (Session) will also be deleted.
[0177] As mentioned above, in existing database systems, large objects may occupy a large amount of storage space. If the same large object data is stored in multiple records, the data will appear repeatedly in the database, resulting in a waste of storage space and performance degradation. Therefore, deduplication of large objects has become one of the important tasks of database management.
[0178] Figure 8 FIG. 1 is a flowchart of a method for deduplicating large objects in a database according to an embodiment of the present invention. Figure 8 As shown, the method for deduplicating large objects in the database includes at least the following steps S701 to S704.
[0179] Step S801, start the large object deduplication task for the target data base table in the database, the target data base table has at least one large object column. The target data base table can be a data base table to be deduplicated specified by a user in the database. In the large object column, the object type of the large object data item can include small objects stored in-line, small objects stored out-of-line, and large objects stored out-of-line, wherein the large objects stored out-of-line are divided into multiple storage slices for storage.
[0180] Step S802, divide the deduplication task into multiple subtasks according to the large object column or the column partition for the large object column, and form a subtask queue. If the large object data is partitioned by column, each column partition can be used as a subtask. If the large object data is not partitioned by column, the large object data can be divided into multiple subsets according to the data characteristics of the large object column (such as data size, content hash, etc.), and data deduplication is performed in units of large object columns or column partitions.
[0181] Step S803: Create a subtask process group based on the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database. The subtask process group may include multiple subtask processes, and the multiple subtask processes determine the parallelism of the deduplication task.
[0182] Step S804, assign the subtasks in the subtask queue to the subtask processes of the subtask process group accordingly, and make each subtask process independently process the subtasks assigned to it. There are many ways to assign subtasks, such as: polling scheduling, that is, assigning subtasks to each process in the subtask process group in turn; priority scheduling, that is, assigning subtasks according to the priority or urgency of subtasks; workload scheduling, that is, assigning subtasks according to the current workload of the subtask process (such as CPU usage, memory occupancy, etc.); dynamic scheduling, that is, dynamically adjusting the assignment of subtasks according to the system performance data and subtask characteristics at runtime.
[0183] The database large object deduplication processing method of the above embodiment can decompose the large object deduplication task into multiple small tasks, and accelerate the entire deduplication process through parallel processing. This can not only improve the processing efficiency, but also better utilize the resources of the database system. At the same time, through reasonable task division and scheduling, the impact of a single task on the database performance can also be reduced, ensuring the stable operation of the database.
[0184] Fig. 9 FIG. 1 is a flowchart of creating a subtask process group in a large object deduplication processing method for a database according to an embodiment of the present invention. Fig. 9 As shown, creating a subtask process group may include the following steps S901 to S904.
[0185] Step S901, obtaining the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database.
[0186] Step S902, determining whether the queue length of the subtask queue is greater than the parallelism parameter of the large object deduplication task configured by the database, if so, executing step S903, if not, executing step S904.
[0187] Step S903: Create a subtask process group whose number of subtask processes is equal to the parallelism parameter value of the large object deduplication task.
[0188] Step S904: Create a subtask process group whose number of subtask processes is equal to the queue length value of the subtask queue.
[0189] The queue length value of the subtask queue represents the number of subtasks waiting to be processed in the current queue, and the parallelism parameter value of the large object deduplication task represents the maximum number of subtask processes that the database system allows to run simultaneously.
[0190] If the queue length is greater than the parallelism parameter, this means that there are more subtasks to be processed, but the system resources (such as the number of CPU cores or threads) may not be sufficient to process all subtasks at the same time. The system will create a number of subtask processes equal to the parallelism parameter value. This ensures that the system does not try to create too many processes, which may exhaust system resources.
[0191] If the queue length is less than or equal to the parallelism parameter, it means that the system has enough resources to process all subtasks at the same time. The system will create a number of subtask processes equal to the length of the subtask queue. This ensures that all subtasks can be processed in a timely manner without causing task delays due to insufficient processes.
[0192] In short, in this way, the system can dynamically adjust the number of subtask processes to adapt to different sizes of deduplication tasks and workloads, which helps to improve the system's responsiveness and overall performance.
[0193] In some embodiments, the step of enabling each subtask process to independently process its assigned subtask includes: identifying the object type of the large object, and deduplicating the large object according to the identified object type.
[0194] In this embodiment, the object types include small objects stored out of line and large objects stored out of line, wherein the data size of the small objects stored out of line is less than or equal to a preset threshold, the data size of the large objects stored out of line is greater than the preset threshold, and the large objects stored out of line are divided into multiple storage slices for storage. The preset threshold may be 32K, or other values, which is not limited in this embodiment.
[0195] Specifically, small objects within a row are not deduplicated. Since small objects within a row are usually small in size, when reading the data base table row containing these objects, these objects will be read into the memory together. Therefore, deduplication of such objects is not only unnecessary, but also wastes system resources. If they are moved out of the row and deduplicated, unnecessary I / O operations may be added, reducing the overall performance of the system.
[0196] Deduplication of out-of-row objects is necessary because these objects may occupy a large amount of storage space and may contain duplicate data. Deduplication of out-of-row objects is usually performed within the scope of columns or column partitions (if any).
[0197] Small objects (e.g. within 32K) can be directly deduplicated as a whole for small objects that are less than or equal to 32K. Since these objects are of moderate size, it is efficient and feasible to process them as a whole. Deduplication as a whole means that the system checks the contents of the entire object to determine if there are duplicates and deletes the duplicate objects accordingly.
[0198] Large objects are deduplicated only on storage slices. For large objects larger than 32K, since their size can be very large, directly deduplicating the entire object will consume a lot of system resources and cause performance degradation. Therefore, it is possible to dedupe only on storage slices of large objects. Storage slicing is the process of splitting large objects into smaller parts so that they can be more easily managed and processed. By deduplicating each slice, it can ensure that duplicate data is effectively removed while maintaining high performance.
[0199] By adopting different deduplication strategies for different types of objects, the database management system can process large object data more efficiently while reducing unnecessary resource waste. Small objects within the row are usually not deduplicated because they are small in size and will be read together; while objects outside the row are deduplicated as a whole or in storage slices according to their size to ensure system performance and efficiency.
[0200] It can be understood that since a storage slice index block is set in the object record of a large object, the storage slice index block records the arrangement order, original data logical length and unique identifier of all storage slices of the large object, while in the object record of a small object, the storage slice index block is set to empty. Therefore, when identifying the object type of a large object, by reading the object record of the large object data item, the object type of the large object data item can be easily identified based on the reading result.
[0201] Fig.10 FIG. 1 is a flowchart of deduplicating small objects in a large object deduplication processing method for a database according to an embodiment of the present invention. Fig.10 As shown, overall deduplication of the identified small objects stored outside the row may include the following steps S1001 to S1004.
[0202] Step S1001, calculating the deduplication feature value of the small objects stored outside the row.
[0203] Step S1002: group small objects with the same deduplication feature value.
[0204] Step S1003, comparing the small objects in each group.
[0205] Step S1004: merge identical small objects into one object.
[0206] Fig.11 , is a flowchart of deduplicating large object storage slices in a large object deduplication processing method for a database according to an embodiment of the present invention, such as Fig.11 As shown, deduplicating storage slices of identified large objects stored out-of-row may include the following steps S1101 to S1104.
[0207] Step S1101, calculating the deduplication feature value of the storage slice of the large object stored outside the row.
[0208] Step S1102, grouping the storage slices having the same deduplication feature value.
[0209] Step S1103, comparing the stored slices in each group.
[0210] Step S1104: merge identical storage slices into one slice.
[0211] In order to speed up the comparison process, in the solution of this embodiment, a characteristic value can be calculated for each small object and storage slice through a deduplication transaction. Only objects with the same characteristic value are likely to have the same content and need to be compared in detail. If the characteristic values are different, the object contents must be different. In the object and storage slice table, each storage slice record contains the deduplication characteristic value of the storage slice itself, and the object record of each small object (≤32K) also contains the deduplication characteristic value of the object itself.
[0212] The calculation of the duplicate removal feature value can use any data digest algorithm or hash algorithm including but not limited to MD5 (Message Digest Algorithm 5), SHA (Secure Hash Algorithm), SHA1 (Secure Hash Algorithm 1), as long as the length of the output result is small and the result length is a constant or has an upper bound.
[0213] In a special case, if the length of the original data is ≤= the length of the digital digest or hash value, the original data itself can be used as the feature value, and there is no need to calculate the feature value. For LOB objects and their slices, this special case is relatively rare.
[0214] In some embodiments, the step of calculating the deduplication feature value of a small object stored out-of-row includes: obtaining the prefetch data field of the small object, i.e., the prefetch field, where only the prefetch field of the small object stored out-of-row contains object data, and then performing a hash calculation on the binary data in the prefetch data field, and finally writing the obtained hash value as the deduplication feature value of the small object into its deduplication feature field, i.e., the dedup_feat field.
[0215] Furthermore, before calculating the deduplication characteristic value of a small object, it can be checked whether the deduplication characteristic value of the small object is empty. If the deduplication characteristic value is empty, the step of calculating the deduplication characteristic value of the small object can be executed. If the deduplication characteristic value is not empty, the deduplication transaction needs to be rolled back.
[0216] Since only the ext_data field of the storage slice contains object data, the MD5 (Message Digest Algorithm 5) algorithm can be used to make a digital summary of the binary data in the ext_data field as its deduplication feature value and written into its dedup_feat field.
[0217] In some embodiments, the step of calculating the deduplication feature value of the storage slice includes: obtaining the additional data field of the storage slice, namely, the ext_data field, performing a hash calculation on the binary data in the additional data field, and writing the obtained hash value as the deduplication feature value of the storage slice into its deduplication feature field, namely, the dedup_feat field.
[0218] In one embodiment, before calculating the deduplication feature value of the storage slice, it is also possible to check whether the deduplication feature value of the storage slice is empty. If the deduplication feature value is empty, the step of calculating the deduplication feature value of the storage slice can be executed. If the deduplication feature value is not empty, it is necessary to select the next storage slice in sequence until the calculation of the deduplication feature values of all storage slices of the large object is completed.
[0219] For large objects stored out of row, their feature values are not calculated and their dedup_feat fields are set to NULL. Since large objects include multiple storage slices, changes in any of the storage slices will cause the object feature values to become outdated and need to be recalculated.
[0220] Since large objects are very large, they cannot be written all at once and can only be written through multiple modifications or appending. It is difficult to find a suitable time to calculate the feature value of a large object while ensuring that the value has a long validity period. Therefore, the solution of this embodiment does not calculate the feature value of a large object to avoid wasting system resources unnecessarily.
[0221] Specifically, after the user enables deduplication on the specified LOB column or column partition: 1. When all small objects stored outside the row are inserted or updated, the deduplication feature value of the object is automatically calculated and written; 2. When all large objects stored outside the row are inserted or updated, the deduplication feature value of the storage slice is automatically calculated and written; 3. The calculation of feature values in the deduplication task is mainly to supplement the feature values of objects or slices that were inserted or updated before deduplication was enabled; in order to reduce the impact on daily business, this task will not be made into a large transaction, but will be split into small transactions as much as possible to proceed step by step; therefore, if a feature value of an object or storage slice is found to have been written during insertion or update in the deduplication task, the feature value calculation of this object or storage slice can be simply skipped and the subsequent work can be continued.
[0222] In some cases, the user may enable the deduplication function for a period of time and then disable it (that is, terminate the current deduplication task and no longer execute it regularly). At this time, you can check the index key on the referenced column ref_id. If there is no non-null value (that is, no reference relationship has been established between any objects or slices), delete the index; otherwise, keep the index. There is no need to do anything with the existing feature values. When a DML operation occurs in the future, update or clear the feature values based on the status of "whether the current deduplication function is enabled".
[0223] When deduplication is enabled, DML operations will synchronously generate and write feature values. When the deduplication task finds that an object or slice already has a feature value, it does not need to regenerate the feature value. It only generates feature values for those objects or slices that do not have feature values yet. When deduplication is disabled, DML operations will set feature values to NULL when modifying data, while objects and slices that have not been modified will still retain valid feature values.
[0224] In the solution of this embodiment, when the DML operation modifies the data, the reference relationship between certain objects or slices will be released (because they are no longer the same), but for performance reasons, it will not immediately check whether the modified objects or slices are duplicates of other objects or slices. Over time, the number of undiscovered duplicate objects or slices may gradually increase. Therefore, when deduplication is enabled, the background needs to redo the deduplication task regularly to improve the deduplication effect. However, given the high cost of deduplication, this time interval will be longer.
[0225] When performing group statistics on small objects stored out of row, you can create a feature value deduplication statistics table for small objects, and then perform group statistics operations on the object records according to the dedup_feat field on the specified large object column or column partition, and filter out repeated feature values and their occurrence times, and write the repeated feature values and their occurrence times into the feature value deduplication statistics table.
[0226] In some embodiments, in the process of writing repeated feature values and their occurrence times into the feature value deduplication statistics table, the repeated deduplication feature values can be sorted from most to least according to the number of occurrences, and the sorted deduplication feature values and their occurrence times can be written into the feature value deduplication statistics table to facilitate querying the object records in the feature value deduplication statistics table.
[0227] When executing the deduplication process, a deduplication transaction can be started, and then the deduplication transaction is used to deduplicate small objects in the characteristic value deduplication statistics table, and the reference identifier ref_id and the reference count ref_count of the small object are updated.
[0228] Specifically, the steps of using the deduplication transaction to deduplicate small objects in the characteristic value deduplication statistical table and updating the reference identifier ref_id and the reference count ref_count of the small objects include:
[0229] Based on the eigenvalue deduplication statistics table, a group of small objects with the same deduplication eigenvalues are obtained, and then one of the small objects is selected as the deduplication benchmark (generally the first small object is selected as the deduplication benchmark). Then, the remaining small objects are traversed and compared with the deduplication benchmark. If the comparison results are the same, the reference identifier ref_id of the currently compared small object is updated to the identifier uuid of the deduplication benchmark, and the reference count ref_count of the comparison benchmark is increased. After all small objects have been compared, the deduplication transaction is submitted and automatically jumps to the next object record in the eigenvalue deduplication statistics table.
[0230] Similarly, when performing group statistics on storage slices, you can create a feature value deduplication statistics table for the storage slices, and then perform group statistics operations on the storage slice records according to the dedup_feat field on the specified large object column or column partition, and filter out repeated feature values and their occurrence times, and write the repeated feature values and their occurrence times into the feature value deduplication statistics table.
[0231] In some embodiments, in the process of writing repeated feature values and their occurrence times into the feature value deduplication statistics table, the repeated deduplication feature values can be sorted from most to least according to the number of occurrences, and the sorted deduplication feature values and their occurrence times can be written into the feature value deduplication statistics table to facilitate querying the storage slice records in the feature value deduplication statistics table.
[0232] When executing the deduplication process, a deduplication transaction can be started, and then the deduplication transaction is used to deduplicate the storage slices in the feature value deduplication statistics table, and the reference identifier ref_id and the reference count ref_count of the storage slice are updated.
[0233] Specifically, the steps of using the deduplication transaction to deduplicate the storage slices in the feature value deduplication statistics table and updating the reference identifier ref_id and the reference count ref_count of the storage slices include:
[0234] Based on the eigenvalue deduplication statistics table, a group of storage slices with the same deduplication eigenvalues are obtained, and then one of the storage slices is selected as the deduplication benchmark (generally the first storage slice is selected as the deduplication benchmark). Then, the remaining storage slices are traversed and compared with the deduplication benchmark. If the comparison results are the same, the reference identifier ref_id of the currently compared storage slice is updated to the identifier uuid of the deduplication benchmark, and the reference count ref_count of the comparison benchmark is increased. After all storage slices are compared, the deduplication transaction is submitted and automatically jumps to the next storage slice record in the eigenvalue deduplication statistics table.
[0235] In some embodiments, a "clustered index" solution may also be used to save grouping statistics. In the subsequent steps of deduplication processing, only the statistics are needed to merge objects or slices, because LOB deduplication is a storage optimization method and does not require 100% deduplication.
[0236] It should be noted that after deduplication is enabled, the DML operation process of large objects will change, and the existing reference relationships (ref_id and ref_count) between objects or slices will be automatically maintained. However, for newly inserted or modified objects and storage slices (new data), in order to reduce the impact on online business, they will not be deduplicated immediately, but will be temporarily regarded as non-duplicate objects or slices.
[0237] The deduplication task running in the background is designed to process these objects and slices that have not been deduplicated. When deduplication is first enabled, all objects are not deduplicated and are mainly processed by the deduplication task. After that, you only need to periodically process all objects and slices with no ref_id value and establish reference relationships.
[0238] In some embodiments, after each subtask process independently processes its assigned subtask, the completion status of all subtask processes can also be obtained. When all subtask processes are completed, the large object deduplication task of the target data base table is reported to be completed.
[0239] That is, after the subtasks are assigned to the various subtask processes and start to execute, the system needs to continuously monitor the completion of these processes, which usually involves tracking the status of each process, such as whether it is still running, whether it has been completed, whether it has encountered an error, etc. The system can periodically check the status of all subtask processes to determine whether they have all completed processing. Only when all subtask processes report a completion status can the entire large object deduplication task be considered completed.
[0240] Through these steps, the system can ensure that all subtasks of the large object deduplication task are processed correctly, and report the task completion in a timely manner after all subtasks are completed, thus providing a reliable and efficient deduplication processing mechanism.
[0241] In some embodiments, the large object deduplication processing method of a database may further include: recording each deduplication task information on each large object column or column partition in the deduplication task history table sys_klob_dedup_tasks of the database, where the deduplication task history table sys_klob_dedup_tasks is a system table related to large object columns generated in the database.
[0242] Recording deduplication task information on each large object column or column partition through the deduplication task history table sys_klob_dedup_tasks helps track task execution, identify potential duplicate tasks, and provide historical references for future deduplication tasks. Recording deduplication task information in the deduplication task history table sys_klob_dedup_tasks helps administrators and developers obtain a detailed view of the deduplication process and make better decisions.
[0243] It should be noted that the cost of each deduplication task is very high. In a multi-user system, there may be a lack of communication between users, resulting in overlapping deduplication tasks being triggered in a short period of time. For example, users A and B issue deduplication enablement commands within a few minutes, and both commands enable deduplication of table column t.lob1. But in fact, deduplication does not need to be 100%, so it is not necessary to perform deduplication frequently. The system can reduce the waste of system resources by automatically eliminating repeated tasks in a short period of time (in the smallest task unit: column or column partition).
[0244] Large object deduplication is a performance optimization measure, and its ultimate goal is to improve the overall performance of the database, rather than pursuing 100% data deduplication. There is no need to ensure that every duplicate object or storage slice is immediately found and simplified. Objects or storage slices that are not simplified will take up more space, but they will not affect the correctness, integrity and subsequent deduplication of the data.
[0245] In some embodiments, the method for deduplicating large objects in a database may further include: checking whether data updates occur during the deduplication process, and if so, skipping the updated objects and continuing deduplication.
[0246] It is understandable that the data in the database is constantly changing, and the results of the deduplication operation are time-sensitive. If the data is immediately compared and deduplicated with a large amount of inventory data after the data changes, it will slow down the speed of daily business and will do a lot of useless work when the data is updated frequently.
[0247] In the solution of this embodiment, the deduplication operation can be intermittent to avoid unnecessary consumption of system resources when data is frequently updated. If data is updated during this period, some intermediate processing results will become invalid. However, since deduplication does not pursue 100% non-repetition, the deduplication task will directly skip these objects that have changed.
[0248] Although large object deduplication is a high-cost operation, it should not affect the daily business of users. Therefore, large object deduplication tasks should be executed regularly in the form of background, low-priority tasks. The execution period can be set through database configuration parameters. In the large object deduplication processing method of this embodiment, for each large object column or column partition, the task is executed in stages and steps in the form of many small transactions to minimize the impact on the daily business of users and avoid competing with the daily business of users for system resources.
[0249] In addition, it should be noted that if the deduplication feature is enabled, the deduplication feature values of objects and chunks are updated synchronously each time the object is updated or the storage slice data is updated. At the same time, the hash index established by the dedup_feat column of the object and storage slice table can speed up the deduplication operation.
[0250] If the deduplication feature is disabled, when the SQL statement that implements the disabling operation is executed, the hash index created on the dedup_feat column of the object and storage slice table when deduplication is enabled will be deleted to reduce the system burden, and the deduplication feature values of all objects and storage slices will be set to NULL to prevent outdated feature values from affecting the correctness of deduplication operations that may occur in the future.
[0251] The flow chart provided by the present embodiment is not intended to indicate that the operation of the method will be performed in any particular order, or that all operations of the method are included in all every case. In addition, the method may include additional operations. Within the scope of the technical thinking provided by the present embodiment method, additional changes may be made to the above method.
[0252] It should be understood that in some embodiments, each part can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
[0253] This embodiment also provides a computer-readable storage medium 20 and a computer device 30 . Fig.12 is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention, Fig.13 is a schematic diagram of a computer device 30 according to one embodiment of the present invention.
[0254] The computer readable storage medium 20 stores the computer program 21, which implements the steps of the large object deduplication processing method of the database in any of the above embodiments when executed by the processor 32. The computer device 30 may include a memory 31, a processor 32, and the computer program 21 stored in the memory 31 and running on the processor 32.
[0255] The computer program 21 for performing the operation of the present invention may be an assembly instruction, an instruction set architecture (ISA) instruction, a machine instruction, a machine-related instruction, a microcode, a firmware instruction, a state setting data, a configuration data of an integrated circuit, or a source code or an object code written in any combination of one or more programming languages and process programming languages. The computer program 21 may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider via the Internet). In some embodiments, in order to perform various aspects of the present invention, an electronic circuit including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA) may execute computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit.
[0256] For the purpose of the description of the present embodiment, the computer readable storage medium 20 is a tangible device capable of retaining and storing a computer program 21, which may be any device that can contain, store, communicate, propagate or transmit the program 21 for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples (a non-exhaustive list) of the computer readable storage medium 20 include the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, and any suitable combination of the foregoing.
[0257] The computer device 30 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smart phone. In some examples, the computer device 30 may be a cloud computing node. The computer device 30 may be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, a program module may include routines, programs, target programs, components, logic, data structures, etc. that perform specific tasks or implement specific abstract data types. The computer device 30 may be implemented in a distributed cloud computing environment where remote processing devices linked via a communication network perform tasks. In a distributed cloud computing environment, program modules may be located on a local or remote computing system storage medium including a storage device.
[0258] The computer device 30 may include a processor 32 adapted to execute stored instructions, and a memory 31 providing temporary storage space for the operation of the instructions during operation. The processor 32 may be a single-core processor, a multi-core processor, a computing cluster, or any number of other configurations. The memory 31 may include a random access memory (RAM), a read-only memory, a flash memory, or any other suitable storage system.
[0259] The computer device 30 may also include a network adapter / interface and an input / output (I / O) interface. The I / O interface allows data to be input and output with external devices that may be connected to the computer device. The network adapter / interface may provide communication between the computer device and a network, which is typically shown as a communication network.
[0260] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all these other variations or modifications.
Claims
1. A method for deduplication of large objects in a database, comprising: Starting a large object deduplication task for a target data base table in the database, wherein the target data base table has at least one large object column; Dividing the deduplication task into a plurality of subtasks according to the large object column or the column partition for the large object column, and forming a subtask queue; Creating a subtask process group based on the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database; The subtasks in the subtask queue are correspondingly assigned to the subtask processes of the subtask process group, and each of the subtask processes independently processes the subtasks assigned thereto.
2. The method for deduplicating large objects in a database according to claim 1, wherein: The step of enabling each subtask process to independently process the subtask assigned to it comprises: Identify the object type of the large object, where the object type includes a small object stored out-of-line and a large object stored out-of-line, wherein the data size of the small object stored out-of-line is less than or equal to a preset threshold, the data size of the large object stored out-of-line is greater than the preset threshold, and the large object stored out-of-line is divided into multiple storage slices for storage; De-duplicate the identified small objects stored outside the row. Dedupe storage slices for identified large objects stored out-of-row.
3. The method for deduplicating large objects in a database according to claim 2, wherein: The steps of overall deduplication of the identified small objects stored out of row include: Calculating duplicate removal feature values of the small objects stored outside the row; Group small objects with the same weight feature value; Compare the small objects in each group; Combines identical small objects into a single object.
4. The method for deduplicating large objects in a database according to claim 2, wherein: The steps of deduplicating storage slices of identified large objects stored out-of-row include: Calculating deduplication feature values of storage slices of the large object stored out of row; Group the stored slices with the same deduplication feature value; The stored sections in each group were compared; Merge identical storage slices into a single slice.
5. The method for deduplicating large objects in a database according to claim 1, wherein: After the step of enabling each of the subtask processes to independently process the subtasks assigned thereto, the method further includes: Obtaining the completion status of all subtask processes; When all the subtask processes are completed, it is reported that the large object deduplication task of the target data base table is completed.
6. The method for deduplicating large objects in a database according to claim 1, wherein: The step of creating a subtask process group based on the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database includes: Obtaining the queue length of the subtask queue and the parallelism parameter of the large object deduplication task configured in the database; Determine whether the queue length of the subtask queue is greater than the parallelism parameter of the large object deduplication task configured in the database; If yes, create a subtask process group whose number of subtask processes is equal to the parallelism parameter value of the large object deduplication task; If not, create a subtask process group whose number of subtask processes is equal to the queue length value of the subtask queue.
7. The method for deduplicating large objects in a database according to claim 1, further comprising: The deduplication task history table of the database records each deduplication task information on each large object column or column partition. The deduplication task history table is a system table generated in the database and related to the large object column.
8. The method for deduplicating large objects in a database according to claim 1, further comprising: Check whether data update occurs during deduplication process; If so, skip the updated object and continue deduplication.
9. A machine-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for deduplicating large objects in a database according to any one of claims 1 to 8.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the large object deduplication processing method for a database according to any one of claims 1 to 8 when executing the computer program.
