| CPC G06F 16/13 (2019.01) [G06F 7/16 (2013.01); G06F 16/185 (2019.01)] | 17 Claims |

|
1. A data compaction method comprising:
determining, by an electronic device, a plurality of Sorted String Table (SSTable) files on which a compaction operation is to be performed among SSTable files stored in a storage device connected to the electronic device, wherein data in the SSTable files stored in the storage device is stored based on a Log Structured Merge Tree (LSM-Tree) mechanism;
based on receiving the plurality of SSTable files from the storage device, performing, by the electronic device, merge sorting on data in data blocks of the plurality of SSTable files based on indexes of the data in the data blocks of the plurality of SSTable files, to obtain reconstructed data blocks; and
sending, by the electronic device, the reconstructed data blocks to the storage device, wherein the reconstructed data blocks are used by the storage device to obtain reconstructed SSTable files,
wherein each SSTable file comprises a data block and an index block, and indexes in each index block correspond to data in the data block corresponding to the index block.
|