Database write amplification optimization method based on frozen page recognition and isolation

By identifying and isolating frozen pages in the database, using heat information and model identification, the frozen pages are directly written to a dedicated partition, which solves the write amplification problem and improves the database performance.

CN120429282AActive Publication Date: 2025-08-05HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510485081.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-08-05
Estimated Expiration
2045-04-17

AI Technical Summary

Technical Problem

The existing technology lacks effective identification and isolation of frozen pages in database load, resulting in serious write amplification problems, affecting SSD life and database performance.

Method used

By recording page popularity information during the database run, divide ZNS SSD into frozen partitions and hot type partitions, and use the trained frozen page recognition model to identify frozen pages, and write them directly to the frozen partition to reduce unnecessary page migration.

Benefits of technology

Effectively reduce write amplification, reduce unnecessary page migration, and improve database performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429282A_ABST
    Figure CN120429282A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of databases and data storage, and discloses a database write amplification optimization method based on frozen page recognition and isolation, which comprises the following steps of: recording heat information of each page in a corresponding page when a database runs; dividing different partitions of the ZNS SSD into frozen partitions and heat type partitions; when the page is expelled by the database, writing the page into the corresponding heat type partition by adopting a rule-based data placement scheme; during garbage collection, effective pages are read into a memory, heat information of the effective pages is input into the trained frozen page recognition model, and whether all the pages are frozen pages or not is output; if the page is the frozen page, directly writing the page into the frozen partition; otherwise, writing the page into the corresponding heat type partition by adopting a rule-based data placement scheme. According to the method, the frozen pages can be effectively isolated and placed, redundant migration of the frozen pages during garbage collection is reduced, and therefore write amplification is effectively reduced, and database performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of databases and data storage, and more specifically, relates to a database write amplification optimization method based on frozen page identification and isolation. Background Art

[0002] NAND flash-based solid-state drives (SSDs), with their performance continuously improving and their cost decreasing, have become the primary persistent storage medium for database systems. With the growth of database scale and the increasing frequency of transaction processing, the I / O workload of modern database systems is often accompanied by a large number of read and write operations. When databases run on NAND flash-based SSDs, write operations often present a common and serious problem: write amplification. The write amplification factor (WAF) is defined as the ratio of the amount of physical data actually written to the underlying flash media to the amount of user data actually written by the host system (i.e., the amount of data written by the database). A high write amplification factor can reduce the lifespan of the SSD, leading to limited SSD bandwidth, unpredictable performance, and high tail latency, further impacting database performance. According to relevant research, when databases are continuously tested on SSDs using the TPC-C benchmark, the write amplification factor can increase to more than four times its initial value. The increasing WAF causes the SSD's I / O per second (IOPS) to decrease, and the number of transactions per minute (TPMC) to drop to one-third of its initial value.

[0003] The physical properties of NAND flash memory prevent it from being updated in-place like traditional disks. Writing to flash memory pages (small read / write units) requires resetting the chip at a larger "erase block" granularity (also known as a superblock) before new data can be written. Due to the limitations of "erase before write," SSDs implement a complex FTL (Flash Translation Layer) module that is invisible to the host. This module converts in-place modifications into appended writes and maintains the mapping between logical page addresses and physical page addresses. When available space is insufficient, the SSD needs to perform garbage collection (GC) operations, copying valid pages within the superblock to a new location before erasing and writing new data, resulting in write amplification of the SSD.

[0004] In databases based on B+ tree index structures, the properties of "write skew" and "temporal locality" often result in a high degree of hot and cold data intermixing. Because SSDs write simultaneously arriving data to the same erase block (regardless of whether the data is hot or cold), frequently updated hot data and long-standing cold data may be mixed and stored on the same erase block. During garbage collection, the SSD must relocate valid cold data to free up space for writing new data. This intermixing of hot and cold data further exacerbates the write amplification problem.

[0005] The key technology to reduce write amplification caused by garbage collection is to isolate and place data based on the expiration time of the data, write pages with similar expiration times into the same erase block, so that they can expire in a similar time, reduce the proportion of valid pages in the block during garbage collection, and thus reduce write amplification. However, existing technical solutions (rule-based data placement solutions) are designed for general block IO loads and lack targeted adaptation to the characteristics of database operation behavior. Specifically, there is a "frozen page" problem in the database load, that is, a large number of pages are frequently rewritten to the SSD within a short time window, but will no longer be updated after this time window. These pages that will no longer be updated are called "frozen pages." The existing technical solutions rely on page heat for placement. When a page becomes a frozen page, it is still partitioned and placed according to different heat levels, which causes unnecessary migration. In addition, the existing technology also lacks an effective method for identifying frozen pages. Summary of the Invention

[0006] In response to the above-mentioned defects or improvement needs of the prior art, the present invention provides a database write amplification optimization method based on frozen page identification and isolation, which aims to reduce the write amplification when the database is stored on SSD, while reducing unnecessary page migration to improve database performance.

[0007] To achieve the above objectives, the present invention provides a database write amplification optimization method based on frozen page identification and isolation, comprising:

[0008] S1. When the database is running, the popularity information of each page is recorded in the corresponding page;

[0009] S2. Divide the different partitions of the ZNS SSD into frozen partitions and hot partitions. When a page is evicted by the database, a rule-based data placement scheme is used to write the evicted page to the corresponding hot partition according to its hotness.

[0010] When S3 and ZNS SSD are running out of space, ZNS SSD performs garbage collection and reads the valid pages written to the hotness type partition into memory;

[0011] S4. Input the heat information of each valid page read into the memory into the trained frozen page recognition model, and the model outputs whether each page is a frozen page; if it is a frozen page, the page is directly written into the frozen partition; otherwise, a rule-based data placement scheme is adopted to write the page into the corresponding heat type partition or frozen partition.

[0012] Furthermore, the rule-based data placement solution is SepBIT, a data isolation method based on block failure time. SepBIT divides the ZNS SSD into first to sixth partitions according to their heat values from high to low, and sets the sixth partition as the frozen partition. The first to fifth partitions are the heat type partitions.

[0013] In S2, SepBIT is used to write pages that are evicted from the database into corresponding hotness type partitions according to their hotness, including:

[0014] S21. Calculate the lifespan of each page evicted by the database, where the lifespan of a page written to the ZNS SSD for the first time is set to infinity; and dynamically maintain a global lifespan threshold, lifespan_threshold, based on the lifespan of each page written to the ZNS SSD within a preset time.

[0015] S22. If the lifespan of the page currently evicted by the database is less than lifespan_threshold, the page is written to the first type of partition; otherwise, the page is written to the second type of partition;

[0016] Correspondingly, in S4, SepBIT is used to write pages to the corresponding hotness type partition, including:

[0017] If the page comes from the first type of partition, it is written to the third type of partition; if the page comes from the second type of partition, the age of the page is calculated; the age of the page is the difference between the time when the current ZNS SSD performs garbage collection and the time when the page was last written to the ZNS SSD;

[0018] If AGE < lifespan_threshold*4, it is written into the fourth partition, where the symbol * represents a multiplication operation; if lifespan_threshold*4≤AGE<lifespan_threshold*16, it is written into the fifth partition; if AGE≥lifespan_threshold*16, it is written into the frozen partition.

[0019] Furthermore, the rule-based data placement solution is a dynamic data clustering method DAC, which divides the ZNS SSD into the first to sixth types of partitions according to the heat value from low to high, and sets the first type of partition as the frozen partition, and the second to sixth types of partitions as the heat type partitions;

[0020] In S2, DAC is used to write pages evicted from the database into corresponding hotness type partitions according to their hotness, including:

[0021] Each page written to the ZNS SSD maintains a heat value. The heat value of a page written to the ZNS SSD for the first time is 2. Each time the page is written to the ZNS SSD, its heat value increases by one, and each time the page is garbage collected, its heat value decreases by one. For each page written to the ZNS SSD, the page with heat value i is written to the i-th partition, and its heat value increases by one; where i∈{2,3,4,5,6};

[0022] Correspondingly, in S4, DAC is used to write pages to the corresponding hotness type partition, including:

[0023] According to the heat value of the page, write the page with heat value i to the i-th partition and reduce its heat value by one.

[0024] Furthermore, the trained frozen page recognition model is obtained by:

[0025] A training sample set is constructed and a frozen page recognition model is trained using the training sample set to obtain the trained frozen page recognition model; wherein the training samples in the training sample set are heat information of the page when it is currently written to the ZNS SSD and heat information of the page when it was last written to the ZNS SSD, and the label is whether the page is a frozen page.

[0026] Furthermore, the constructing of the training sample set includes:

[0027] Perform a database load test and record the heat information of each page when it is written to the ZNS SSD, as well as the expiration time after the page is written to the ZNS SSD. If the page will no longer be written to the SSD, the expiration time is a predefined invalid value. The heat information includes: the time WT when the page is written to the ZNS SSD, the amount of valid data VD of the page, the average read interval AI of the page within time T, the average write interval MI of the page within time T, the number of page reads AC within time T, and the number of page writes MC within time T. The time T is the time from when the page is read from the memory to when the page is written to the ZNS SSD.

[0028] Determine whether the page is a frozen page based on the expiration time: if the expiration time is an invalid value, the page is a frozen page; otherwise, it is a normal page, and each page is labeled as a frozen page;

[0029] After normalizing the heat information of each page, the heat information HR_current of each page when it is currently written to the ZNS SSD and the heat information HR_last when the page was last written to the ZNS SSD are extracted as training samples to obtain the training sample set; wherein, the HR_last when written to the ZNS SSD for the first time is 0.

[0030] Furthermore, the frozen page recognition model is a logistic regression model.

[0031] Furthermore, the frozen page recognition model is a long short-term memory neural network model.

[0032] The present invention also provides a database write amplification optimization system based on frozen page identification and isolation, comprising a computer-readable storage medium and a processor;

[0033] The computer-readable storage medium is used to store executable instructions;

[0034] The processor is configured to read the executable instructions stored in the computer-readable storage medium to execute any one of the above-mentioned database write amplification optimization methods based on frozen page identification and isolation.

[0035] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the database write amplification optimization method based on frozen page identification and isolation as described in any one of the above items.

[0036] The present invention also provides a computer program product, including a computer program. When the computer program is run on a computer, the computer is enabled to execute any of the above-mentioned database write amplification optimization methods based on frozen page identification and isolation.

[0037] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0038] (1) The database write amplification optimization method based on frozen page identification and isolation of the present invention divides different partitions of the ZNS SSD into frozen partitions for storing frozen pages and heat type partitions for storing normal pages; when a page is written to the SSD, the page is first written to the heat type partition corresponding to the ZNS SSD according to the existing rule-based data placement scheme according to the different heat levels. When the SSD performs garbage collection, based on the heat information of the page, the frozen page identification model is used to identify the valid pages in the memory. If it is identified as a frozen page, it is directly placed in the frozen partition dedicated to the frozen page. Otherwise, it is placed in the heat type partition corresponding to the ZNS SSD according to the different heat levels according to the existing rule-based data placement scheme. In this way, effective frozen page isolation is achieved, unnecessary page migration is avoided, and while reducing the write amplification caused by garbage collection, database performance is improved.

[0039] (2) As a preferred embodiment, the database write amplification optimization method based on frozen page identification and isolation in the embodiment of the present invention improves the existing rule-based data placement schemes SepBIT and DAC, realizes active isolation and placement of frozen pages, and seamlessly integrates with the rule-based data placement scheme, which can effectively reduce write amplification and improve database performance.

[0040] (3) Furthermore, in the process of constructing the training sample set, the present invention collects six characteristic variables that have a strong correlation with the frozen page to form a piece of heat information. The constructed data sample can fully reflect the characteristics of the page; and according to the expiration time of the page, it is judged whether the page has become a frozen page, which can make full use of the page characteristics and effectively identify the frozen page.

[0041] (4) As a preferred method, a logistic regression model is used as a frozen page identification model. As a low-cost and effective classification algorithm model, the logistic regression model can efficiently classify frozen pages.

[0042] In summary, the learning-based frozen page identification and isolation scheme (SepFrozen) of the present invention is based on a designed effective frozen page identification model. The model is used to extract frozen pages from valid pages during system garbage collection and place them in an isolated area to avoid mixing with normal pages, thereby reducing write amplification when the database is stored on SSD and improving database performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a frozen page isolation mechanism provided by an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of a database frozen page-aware data placement method provided by an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of another database frozen page-aware data placement method provided by an embodiment of the present invention;

[0046] Figure 4 A schematic structural diagram of a learning-based database frozen page recognition model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to illustrate the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

[0048] In the present invention, the terms "first", "second", etc. in the present invention and the accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0049] Example 1

[0050] like Figure 1 As shown, an embodiment of the present invention provides a database write amplification optimization method based on frozen page identification and isolation, which mainly includes:

[0051] S1. When the database is running, the popularity information of each page is recorded in the corresponding page. In the embodiment of the present invention, the database is a database based on a B+ tree index structure.

[0052] S2. The different partitions of the ZNS SSD (Zoned Namespace SSD) are divided into frozen partitions for storing frozen pages and hot partitions for storing normal pages. When a page is evicted by the database, a rule-based data placement scheme (such as SepBIT and DAC) is used to write the evicted page to the corresponding hot partition of the ZNS SSD according to its hotness.

[0053] S3. When the SSD system space is insufficient, the SSD performs garbage collection operations and reads the valid pages written into the different heat type partitions of the ZNS SSD into the memory; among them, the valid pages store the data content currently recognized by the system, in contrast to the invalid pages (Invalid Page) that have been overwritten or deleted. When the system updates the data, the new data is written to the new physical page, and the original storage location page is automatically marked as invalid. The page newly written to the SSD is the valid page. If the page is written to the SSD, it will not be written to the SSD again, and the page is also a valid page.

[0054] S4. Input the heat information of each valid page read into the memory into the trained frozen page recognition model. The frozen page recognition model is used to determine whether each page is a frozen page. If it is a frozen page, the page is directly written to the frozen partition of the SSD. Otherwise, a rule-based data placement scheme is adopted to write the page to the corresponding heat type partition or frozen partition of the SSD.

[0055] As a preferred implementation method, the rule-based data placement solution is the improved SepBIT (data isolation technology based on block failure time). The improved SepBIT divides the ZNS SSD into the first to sixth partitions according to the heat value from high to low, with a total of 6 partitions. The sixth partition is set as the frozen partition, and the first to fifth partitions are heat type partitions used to store normal pages.

[0056] like Figure 2 As shown in S2, when a page is evicted by the database, SepBIT is used to write the evicted page to the corresponding heat type partition of the ZNS SSD according to its heat level, including:

[0057] S21. Calculate the lifecycle of the page evicted by the database, where the method for calculating the page lifecycle is the existing technology. The lifecycle of the page represents the popularity of the page. The longer the lifecycle, the lower the popularity. If the page is written to the SSD for the first time, its lifecycle is set to infinity. A global lifecycle threshold, lifespan_threshold, is dynamically maintained based on the lifecycle of each page written to the SSD within a preset time.

[0058] S22. If the lifespan of the page currently evicted by the database is less than lifespan_threshold, the page is written to the first type of partition; otherwise, the page is written to the second type of partition.

[0059] Correspondingly, in S4, the improved SepBIT is used to write pages to the SSD's corresponding hotness type partition, including:

[0060] If the current page comes from the first type of partition, it is placed in the third type of partition; if the current page comes from the second type of partition, the age of the current page is calculated (the difference between the current garbage collection time and the time when the page was last written to the SSD); if the age is less than the threshold lifespan_threshold*4, it is placed in the fourth partition, and the symbol * represents a multiplication operation; if the age is greater than or equal to the threshold lifespan_threshold*4 and less than the threshold lifespan_threshold*16, it is placed in the fifth type of partition; if the age is greater than or equal to the threshold lifespan_threshold*16, it is placed in the sixth type of partition.

[0061] As a preferred implementation method, the rule-based data placement solution is an improved dynamic data clustering method (DAC). The improved DAC divides the ZNS SSD into the first to sixth partitions according to the heat value from low to high, a total of 6 partitions. The first partition is set as the frozen partition, and the second to sixth partitions are heat type partitions used to store normal pages.

[0062] like Figure 3 As shown in S2, when a page is evicted by the database, DAC is used to write the page evicted by the database into the corresponding heat type partition of the ZNS SSD according to its heat level, including:

[0063] S21. Each page written to the ZNS SSD maintains a heat value. The heat value of the page written to the ZNS SSD for the first time is 2. Each time the page is written to the ZNS SSD, the heat value increases once. Each time the page is garbage collected, the heat value decreases once.

[0064] S22. For each page written to the ZNS SSD, the page with a heat value of i is written to the i-th partition and its heat value is incremented once; where i∈{2,3,4,5,6}.

[0065] Correspondingly, in S4, DAC is used to write pages to the SSD's corresponding hotness type partition, including:

[0066] According to the heat value of the page, write the page with heat value i to the i-th partition and decrement its heat once.

[0067] As a preferred implementation, in S4, the training method of the frozen page recognition model includes:

[0068] (1) Perform a database load test and record the heat information of each page when it is written to the SSD, as well as the expiration time after the page is written to the SSD. If the page will not be written to the SSD again, the expiration time is a predefined invalid value. In an embodiment of the present invention, the heat information includes six characteristic variables of the page, namely, the time when the page is written to the SSD (WT), the amount of valid data on the page (VD), the average read interval (AI) of the page within time T, the average write interval (MI) of the page within time T, the number of reads (AC) of the page within time T, and the number of writes (MC) of the page within time T, where time T is the time from each time the page is read from the memory to the time the page is written to the SSD; a tuple consisting of the six characteristic variables (WT, VD, AI, MI, AC, MC) is called a heat record, i.e., heat information. The expiration time after the page is written to the SSD is the time when the page is written to the SSD next time.

[0069] (2) Determine whether the page has become a frozen page based on the expiration time of the page: if the expiration time is a normal value (not an invalid value), the page is a normal page; if the expiration time is an invalid value, the page becomes a frozen page, and each page is labeled as a frozen page.

[0070] (3) After normalizing the heat information of each page when it is written to the SSD, extract the heat information of each page when it is currently written to the SSD (HR_current) and the heat information of the page when it was last written to the SSD (HR_last). If the page is written to the SSD for the first time, set its HR_last to all 0s, thereby obtaining a data set for training the frozen page recognition model; wherein, a sample in the data set is the heat information of a page when it is currently written to the SSD and the heat information of the page when it was last written to the SSD, and the label is whether the page is a frozen page.

[0071] (4) Randomly sample each sample in the dataset and divide it into training set and test set in a ratio of 3:1. 75% of the data is allocated to the training set to train the frozen page recognition model, and the test set is used to test the performance of the model.

[0072] During the model training process, it is used to determine whether a page is a frozen page based on the page heat information. This is a binary classification problem that can be solved using a logistic regression model (LR model). After the logistic regression model performs a dot product on the heat information and the weight vector determined by the model, it uses the sigmoid function to map it to a probability value between 0 and 1. If the probability value is greater than a set threshold (usually 0.5), the model output category is "frozen", otherwise, the output category is "normal". The LR model uses Maximum Likelihood Estimation (MLE) to solve the weight vector. In order to further enhance the fitting performance of the model, in an embodiment of the present invention, the stochastic gradient descent (SGD) algorithm is used instead of MLE to solve the weight vector, and the logistic regression model using the stochastic gradient descent algorithm is called an SGD model. Since logistic regression does not support time series feature input, in an embodiment of the present invention, HR_last (HRlast) and HR_current (HRcurrent) are stacked to form a single 12-dimensional vector, such as Figure 4 As shown, the SGD model is trained using the training set. In other embodiments, the frozen page recognition model can also use a network model that supports temporal feature input, such as a long short-term memory neural network or other network model to achieve classification.

[0073] Online reasoning is used to use the model to determine the frozen page nature of a page when the database is actually running. The input of the model is the heat information of the page when it is currently written to the SSD and the heat information of the page when it was last written to the SSD, and the output is whether the page is a frozen page. The model has two types of misclassification situations, namely missed reports (i.e., misclassifying a frozen page as a normal page) and false reports (i.e., misclassifying a normal page as a frozen page). Pages that are missed will be subject to multiple redundant migrations according to the existing rule-based data placement scheme and eventually arrive at the frozen partition. For pages that are misreported, as long as the page is modified and rewritten to the SSD next time, the original address page will become invalid, and the newly written page will be written to the corresponding non-frozen partition (heat type partition).

[0074] The machine learning-based frozen page identification model in the embodiments of the present invention can efficiently extract frozen pages from pages to be reclaimed with low overhead. The learning-based frozen page identification and isolation mechanism can be seamlessly integrated with various existing rule-based data placement solutions.

[0075] In an embodiment of the present invention, two frozen page-aware data placement methods are obtained by combining a learning-based frozen page identification and isolation mechanism, which are improved by two currently efficient rule-based data placement algorithms. These methods can effectively isolate and place frozen pages, reduce redundant migration of frozen pages during garbage collection, and thus effectively reduce write amplification and improve database performance.

[0076] Example 2

[0077] An embodiment of the present invention provides a database write amplification optimization system based on frozen page identification and isolation, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the database write amplification optimization method based on frozen page identification and isolation in the above-mentioned embodiment 1.

[0078] The relevant technical solutions are the same as above and will not be repeated here.

[0079] Example 3

[0080] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the database write amplification optimization method based on frozen page identification and isolation in the above-mentioned embodiment 1 are implemented.

[0081] The relevant technical solutions are the same as above and will not be repeated here.

[0082] Example 4

[0083] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is run on a computer, the computer executes the steps of the database write amplification optimization method based on frozen page identification and isolation in the above-mentioned embodiment 1.

[0084] The relevant technical solutions are the same as above and will not be repeated here.

[0085] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A database write amplification optimization method based on frozen page identification and isolation, characterized in that: include: S1. When the database is running, the popularity information of each page is recorded in the corresponding page; S2. Divide the different partitions of the ZNS SSD into frozen partitions and hot partitions. When a page is evicted by the database, a rule-based data placement scheme is used to write the evicted page to the corresponding hot partition according to its hotness. When S3 and ZNS SSD are running out of space, ZNS SSD performs garbage collection and reads the valid pages written to the hotness type partition into memory; S4. Input the heat information of each valid page read into the memory into the trained frozen page recognition model, and the model outputs whether each page is a frozen page; If it is a frozen page, the page is directly written to the frozen partition; otherwise, a rule-based data placement solution is adopted to write the page to the corresponding hot type partition or frozen partition.

2. The database write amplification optimization method based on frozen page identification and isolation according to claim 1 is characterized in that: The rule-based data placement solution is SepBIT, a data isolation method based on block failure time. SepBIT divides the ZNSSSD into first to sixth partitions according to their heat values from high to low, and sets the sixth partition as the frozen partition. The first to fifth partitions are the heat type partitions. In S2, SepBIT is used to write pages that are evicted from the database into corresponding hotness type partitions according to their hotness, including: S21. Calculate the lifespan of each page evicted by the database, where the lifespan of a page written to the ZNS SSD for the first time is set to infinity; and dynamically maintain a global lifespan threshold, lifespan_threshold, based on the lifespan of each page written to the ZNS SSD within a preset time. S22. If the lifespan of the page currently evicted by the database is less than lifespan_threshold, the page is written to the first type of partition; otherwise, the page is written to the second type of partition; Correspondingly, in S4, SepBIT is used to write pages to the corresponding hotness type partition, including: If the page comes from the first type of partition, it is written to the third type of partition; if the page comes from the second type of partition, the age of the page is calculated; the age of the page is the difference between the time when the current ZNS SSD performs garbage collection and the time when the page was last written to the ZNS SSD; If AGE < lifespan_threshold*4, it is written into the fourth partition, where the symbol * represents a multiplication operation; if lifespan_threshold*4≤AGE<lifespan_threshold*16, it is written into the fifth partition; if AGE≥lifespan_threshold*16, it is written into the frozen partition.

3. The database write amplification optimization method based on frozen page identification and isolation according to claim 1 is characterized in that: The rule-based data placement solution is a dynamic data clustering method DAC, which divides the ZNS SSD into the first to sixth types of partitions according to the heat value from low to high, and sets the first type of partition as the frozen partition, and the second to sixth types of partitions as the heat type partitions; In S2, DAC is used to write pages evicted from the database into corresponding hotness type partitions according to their hotness, including: Each page written to the ZNS SSD maintains a heat value. The heat value of a page written to the ZNS SSD for the first time is 2. Each time the page is written to the ZNS SSD, its heat value increases by one, and each time the page is garbage collected, its heat value decreases by one. For each page written to the ZNS SSD, the page with heat value i is written to the i-th partition, and its heat value increases by one; where i∈{2,3,4,5,6}; Correspondingly, in S4, DAC is used to write pages to the corresponding hotness type partition, including: According to the heat value of the page, write the page with heat value i to the i-th partition and reduce its heat value by one.

4. The database write amplification optimization method based on frozen page identification and isolation according to any one of claims 1 to 3, characterized in that: The trained frozen page recognition model is obtained in the following way: A training sample set is constructed and a frozen page recognition model is trained using the training sample set to obtain the trained frozen page recognition model; wherein the training samples in the training sample set are heat information of the page when it is currently written to the ZNS SSD and heat information of the page when it was last written to the ZNS SSD, and the label is whether the page is a frozen page.

5. The database write amplification optimization method based on frozen page identification and isolation according to claim 4 is characterized in that: The constructing of the training sample set includes: Perform a database load test and record the heat information of each page when it is written to the ZNS SSD, as well as the expiration time after the page is written to the ZNS SSD. If the page will no longer be written to the SSD, the expiration time is a predefined invalid value. The heat information includes: the time WT when the page is written to the ZNS SSD, the amount of valid data VD of the page, the average read interval AI of the page within time T, the average write interval MI of the page within time T, the number of page reads AC within time T, and the number of page writes MC within time T. The time T is the time from when the page is read from the memory to when the page is written to the ZNS SSD. Determine whether the page is a frozen page based on the expiration time: if the expiration time is an invalid value, the page is a frozen page; otherwise, it is a normal page, and each page is labeled as a frozen page; After normalizing the heat information of each page, the heat information HR_current of each page when it is currently written to the ZNS SSD and the heat information HR_last when the page was last written to the ZNS SSD are extracted as training samples to obtain the training sample set; wherein, the HR_last when written to the ZNS SSD for the first time is 0.

6. The database write amplification optimization method based on frozen page identification and isolation according to claim 4 is characterized in that: The frozen page recognition model is a logistic regression model.

7. The database write amplification optimization method based on frozen page identification and isolation according to claim 4 is characterized in that: The frozen page recognition model is a long short-term memory neural network model.

8. A database write amplification optimization system based on frozen page identification and isolation, characterized in that: comprising a computer-readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the database write amplification optimization method based on frozen page identification and isolation according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the database write amplification optimization method based on frozen page identification and isolation as described in any one of claims 1 to 7 is implemented.

10. A computer program product, characterized in that The invention comprises a computer program, which, when running on a computer, enables the computer to execute the database write amplification optimization method based on frozen page identification and isolation according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Solid-state storage method, system and equipment based on file system optimization

    CN114356797A

  • Data placement method and system suitable for ZNS SSD write amplification optimization

    CN116974479A