一句话:提出面向持久内存的故障原子槽页结构,利用 HTM 与槽头日志降低数据库日志开销并提升查询性能。
针对传统数据库在维护一致性时对槽式页进行冗余写入的问题,本文提出面向持久内存的故障原子槽式页结构,利用持久内存的字节可寻址性和持久性减少写放大。方案包含两个关键要素:基于硬件事务内存的页内就地提交,以及记录每页提交标记的槽头日志。作者在 SQLite 中实现该方案,并与当前最先进的 NVWAL 进行对比。结果表明,对插入单条记录的事务,该方案达到最优性能;对跨多个数据库页的事务,槽头日志仅记录脏页元数据、避免页复制,从而最小化日志开销。总体而言,日志开销降至 NVWAL 的 1/6,查询响应时间最多提升 33%。
The slotted-page structure is a database page format commonly used for managing variable-length records. In this work, we develop a novel "failure-atomic slotted page structure" for persistent memory that leverages byte addressability and durability of persistent memory to minimize redundant write operations used to maintain consistency in traditional database systems. Failure-atomic slotted paging consists of two key elements: (i) in-place commit per page using hardware transactional memory and (ii) slot header logging that logs the commit mark of each page. The proposed scheme is implemented in SQLite and compared against NVWAL, the current state-of-the-art scheme. Our performance study shows that our failure-atomic slotted paging shows optimal performance for database transactions that insert a single record. For transactions that touch more than one database page, our proposed slot-header logging scheme minimizes the logging overhead by avoiding duplicating pages and logging only the metadata of the dirty pages. Overall, we find that our failure-atomic slotted-page management scheme reduces database logging overhead to 1/6 and improves query response time by up to 33% compared to NVWAL.