---
title: Binlog writeset_history优化
description: 应用场景：MySQL OLTP的只写场景。
url: "https://www.hikunpeng.com/document/detail/zh/kunpengdbs/twp/kunpengdatabase_21_044.html"
---

# Binlog writeset_history优化

应用场景：MySQL OLTP的只写场景。

技术原理：将m_writeset_history变量使用的std::map替换为hash map数据结构，将插入和查找的时间复杂度降为O(1)，以提高效率。

性能指标：在Percona-Server 5.7.44-53版本8C16G容器规格中，在Sysbench的只写测试场景可获得5%的性能提升。


如何使用

请参见《MySQL Binlog writeset_history数据结构优化 特性指南(https://www.hikunpeng.com/document/detail/zh/boostdb/mysql/binlog_lock_opt/docs/zh/mysql_binlog_writeset_history_optimization_feature_guide.md)》。
