摘要 |
Embodiments of the present invention disclose a method and an apparatus for data preheating, which relate to database technologies, so as to increase a responding speed of a database system, reduce frequent IO on a magnetic disk, and improve overall performance of the database system. The method includes: when a database is started, reading hit ratio information from a flash memory device and reading user configuration information from a hard disk; obtaining a union set of a preset hot data table in the user configuration information and a hot data table in the hit ratio information; determining the total number of to-be-loaded hot data blocks from the union set; according to the storage proportions, determining the to-be-loaded hot data block to be stored into a shared buffer and the flash memory device; and separately storing the to-be-loaded hot data block into the shared buffer and the flash memory device. |
主权项 |
1. A method for data preheating, the method comprising:
reading, separately, hit ratio information and user configuration information when a database is started, wherein the hit ratio information comprises a hot data table, and the user configuration information comprises a preset hot data table, storage proportions of a to-be-loaded hot data block stored into a shared buffer and a flash memory device, a capacity of the shared buffer, a storage capability of the flash memory device, and a deviation value of the total number of the to-be-loaded hot data blocks; obtaining a union set of the preset hot data table in the user configuration information and the hot data table in the hit ratio information; determining the total number of the to-be-loaded hot data blocks from the union set according to the storage proportions, the capacity of the shared buffer, a capacity of the flash memory device, a size of the hot data block, and the deviation value; determining, according to the storage proportions, the to-be-loaded hot data block to be stored into the shared buffer and the flash memory device; and storing, separately, the to-be-loaded hot data block into the shared buffer and the flash memory device. |