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

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

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

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