[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"primary-menu":3,"site-config":82,"cat-mysql":99,"catposts-mysql":112,"post-detail-post-mysql-transaction-acid-5795447c":221},{"metadata":4,"spec":7,"menuItems":17},{"name":5,"creationTimestamp":6},"primary","2026-09-12T06:13:55.024154Z",{"displayName":8,"menuItems":9},"主菜单",[10,11,12,13,14,15,16],"88c3f10b-321c-4092-86a8-70db00251b74","menu-item-izrtmxer","c4c814d1-0c2c-456b-8c96-4864965fee94","menu-item-column","menu-item-tools","menu-item-zsxq","menu-item-ocrxlczu",[18,27,37,46,55,64,73],{"displayName":19,"metadata":20,"spec":22,"status":25,"children":26},"首页",{"name":10,"creationTimestamp":21},"2026-09-12T06:13:54.422830Z",{"displayName":19,"href":23,"priority":24,"menuName":5},"\u002F",0,{"displayName":19,"href":23},[],{"displayName":28,"metadata":29,"spec":31,"status":35,"children":36},"Java面试八股",{"name":11,"creationTimestamp":30},"2026-09-13T09:42:02.854891Z",{"displayName":28,"href":32,"target":33,"priority":34,"menuName":5},"\u002Fjava-interview","_self",1,{"displayName":28,"href":32},[],{"displayName":38,"metadata":39,"spec":41,"status":44,"children":45},"文章",{"name":12,"creationTimestamp":40},"2026-09-12T06:13:54.457307Z",{"displayName":38,"href":42,"priority":43,"menuName":5},"\u002Farchives",2,{"displayName":38,"href":42},[],{"displayName":47,"metadata":48,"spec":50,"status":53,"children":54},"项目实战",{"name":13,"creationTimestamp":49},"2026-09-14T00:35:08.138170Z",{"displayName":47,"href":51,"target":33,"priority":52,"menuName":5},"\u002Fcolumn",3,{"displayName":47,"href":51},[],{"displayName":56,"metadata":57,"spec":59,"status":62,"children":63},"在线工具",{"name":14,"creationTimestamp":58},"2026-09-14T00:35:08.171474Z",{"displayName":56,"href":60,"target":33,"priority":61,"menuName":5},"\u002Ftools",4,{"displayName":56,"href":60},[],{"displayName":65,"metadata":66,"spec":68,"status":71,"children":72},"知识星球",{"name":15,"creationTimestamp":67},"2026-09-14T00:35:08.199145Z",{"displayName":65,"href":69,"target":33,"priority":70,"menuName":5},"\u002Fzsxq",5,{"displayName":65,"href":69},[],{"displayName":74,"metadata":75,"spec":77,"status":80,"children":81},"特价云服务器",{"name":16,"creationTimestamp":76},"2026-09-25T15:30:59.201614Z",{"displayName":74,"href":78,"target":33,"priority":79,"menuName":5},"\u002Fserver",6,{"displayName":74,"href":78},[],{"config":83,"socialLinks":98},{"title":84,"subtitle":85,"logoUrl":86,"faviconUrl":87,"footerText":88,"beianIcp":89,"beianPublicSecurity":88,"seoDescription":90,"seoKeywords":91,"homepageTitle":92,"homepageSubtitle":93,"analyticsHeadCode":94,"planetQrcodeUrl":95,"planetIntroHtml":88,"planetCtaText":96,"updatedAt":97},"编码世界","用编码改变世界","\u002Fupload\u002F2026\u002F09\u002F2f277021172f43f6bb34e1c115760b7f.png","\u002Fupload\u002F2026\u002F09\u002Fdcbad022e68c4a729a5dc4997a9bba8a.png","","苏ICP备2026073884号","编码世界（mashangan.com）是面向 Java 后端与 Go 语言的系统化编程教程站：提供\nMyBatis Plus、Lombok、Java 8、IDEA、Docker 等原创图文教程，以及 JVM、并发、\nSpring、MySQL、Redis、消息队列、计算机网络等大厂面试八股题库，另有可落地的\n项目实战系列，帮你从入门到精通。","编码世界,Java教程,Go语言教程,Docker教程,MyBatis Plus教程,Lombok教程, Java 8新特性,IDEA教程,Java面试题,八股文,JVM面试题,Java并发面试题, MySQL面试题,Redis面试题,Spring面试题,消息队列面试题,高并发,分库分表, Netty面试题,计算机网络面试题,AI Agent,RAG,程序员学习路线","Java全栈系统化编程教程","覆盖 MyBatis Plus、Lombok、Java 8、IDEA、Go、Docker 等原创图文教程，配套大厂面试八股题库，从入门到精通，持续更新","\u003Cscript>\nvar _hmt = _hmt || [];\n(function() {\n  var hm = document.createElement(\"script\");\n  hm.src = \"https:\u002F\u002Fhm.baidu.com\u002Fhm.js?f00af7e56d956c02e11efed4131379b0\";\n  var s = document.getElementsByTagName(\"script\")[0]; \n  s.parentNode.insertBefore(hm, s);\n})();\n\u003C\u002Fscript>\n","\u002Fupload\u002F2026\u002F09\u002Fc1a8f5de46584d3eb0bc762c180a5db9.png","扫码加入知识星球","2026-09-29T14:56:02.498693Z",[],{"metadata":100,"spec":105,"status":110,"postCount":70},{"name":101,"creationTimestamp":102,"labels":103},"mysql","2026-09-13T09:13:25.545156Z",{"haloweb.section":104},"interview",{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},"MySQL 面试题","MySQL 面试题：索引原理、事务隔离、锁机制、SQL 调优、日志体系与分库分表。",11,false,{"permalink":111,"postCount":70,"visiblePostCount":70},"\u002Fcategories\u002Fmysql",[113,137,158,179,200],{"metadata":114,"spec":117,"status":126,"categories":131},{"name":115,"creationTimestamp":116},"post-mysql-slow-sql-72d516f1","2026-09-13T10:00:56.554547Z",{"title":118,"slug":119,"cover":88,"excerpt":120,"publishTime":122,"categories":123,"tags":124,"priority":24,"pinned":109,"deleted":109,"visible":125,"allowComment":121},"如何排查和优化慢 SQL？","mysql-slow-sql",{"raw":88,"autoGenerate":121},true,"2026-09-13T10:00:56.602215Z",[101],[],"PUBLIC",{"permalink":127,"excerpt":128,"lastModifyTime":129,"phase":130},"\u002Farchives\u002Fmysql-slow-sql","一、排查步骤 开启慢查询日志：slow_query_log = ON，long_query_time = 1。 用 explain 分析执行计划，关注 type、key、rows、Extra。 用 show profile 看各阶段耗时。 二、常见优化 索引：给 where、join、order b","2026-09-16T09:13:50.446266Z","PUBLISHED",[132],{"metadata":133,"spec":135,"status":136,"postCount":70},{"name":101,"creationTimestamp":102,"labels":134},{"haloweb.section":104},{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},{"permalink":111,"postCount":70,"visiblePostCount":70},{"metadata":138,"spec":141,"status":148,"categories":152},{"name":139,"creationTimestamp":140},"post-mysql-mvcc-6bac3675","2026-09-13T10:00:56.263936Z",{"title":142,"slug":143,"cover":88,"excerpt":144,"publishTime":145,"categories":146,"tags":147,"priority":24,"pinned":109,"deleted":109,"visible":125,"allowComment":121},"什么是 MVCC？","mysql-mvcc",{"raw":88,"autoGenerate":121},"2026-09-13T10:00:56.441642Z",[101],[],{"permalink":149,"excerpt":150,"lastModifyTime":151,"phase":130},"\u002Farchives\u002Fmysql-mvcc","一、定义 MVCC（Multi-Version Concurrency Control，多版本并发控制），通过维护数据的多个历史版本，实现读写不阻塞，提高并发性能。 二、实现要素 隐藏字段：每行有 trx_id（创建该版本的事务 ID）和 roll_pointer（指向 undo log 中的上一版","2026-09-16T09:13:48.546617Z",[153],{"metadata":154,"spec":156,"status":157,"postCount":70},{"name":101,"creationTimestamp":102,"labels":155},{"haloweb.section":104},{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},{"permalink":111,"postCount":70,"visiblePostCount":70},{"metadata":159,"spec":162,"status":169,"categories":173},{"name":160,"creationTimestamp":161},"post-mysql-isolation-levels-38ba7e64","2026-09-13T10:00:55.948391Z",{"title":163,"slug":164,"cover":88,"excerpt":165,"publishTime":166,"categories":167,"tags":168,"priority":24,"pinned":109,"deleted":109,"visible":125,"allowComment":121},"MySQL 的四种事务隔离级别？","mysql-isolation-levels",{"raw":88,"autoGenerate":121},"2026-09-13T10:00:56.137691Z",[101],[],{"permalink":170,"excerpt":171,"lastModifyTime":172,"phase":130},"\u002Farchives\u002Fmysql-isolation-levels","一、四种级别（由低到高） 隔离级别 脏读 不可重复读 幻读 READ UNCOMMITTED 可能 可能 可能 READ COMMITTED 否 可能 可能 REPEATABLE READ（InnoDB 默认） 否 否 否（间隙锁） SERIALIZABLE 否 否 否 二、问题解释 脏读：读到其他","2026-09-16T09:13:49.485728Z",[174],{"metadata":175,"spec":177,"status":178,"postCount":70},{"name":101,"creationTimestamp":102,"labels":176},{"haloweb.section":104},{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},{"permalink":111,"postCount":70,"visiblePostCount":70},{"metadata":180,"spec":183,"status":190,"categories":194},{"name":181,"creationTimestamp":182},"post-mysql-transaction-acid-5795447c","2026-09-13T10:00:55.754027Z",{"title":184,"slug":185,"cover":88,"excerpt":186,"publishTime":187,"categories":188,"tags":189,"priority":24,"pinned":109,"deleted":109,"visible":125,"allowComment":121},"事务的 ACID 特性是什么？","mysql-transaction-acid",{"raw":88,"autoGenerate":121},"2026-09-13T10:00:55.826031Z",[101],[],{"permalink":191,"excerpt":192,"lastModifyTime":193,"phase":130},"\u002Farchives\u002Fmysql-transaction-acid","一、原子性（Atomicity） 事务中的操作要么全部成功，要么全部失败回滚。由 undo log 保证：记录修改前的旧值，回滚时反向操作。 二、一致性（Consistency） 事务前后数据满足业务约束。由原子性、隔离性、持久性共同保证，是事务的最终目标。 三、隔离性（Isolation） 并发事","2026-09-16T09:13:49.020776Z",[195],{"metadata":196,"spec":198,"status":199,"postCount":70},{"name":101,"creationTimestamp":102,"labels":197},{"haloweb.section":104},{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},{"permalink":111,"postCount":70,"visiblePostCount":70},{"metadata":201,"spec":204,"status":211,"categories":215},{"name":202,"creationTimestamp":203},"post-mysql-index-btree-61981a83","2026-09-13T10:00:55.574621Z",{"title":205,"slug":206,"cover":88,"excerpt":207,"publishTime":208,"categories":209,"tags":210,"priority":24,"pinned":109,"deleted":109,"visible":125,"allowComment":121},"MySQL 索引为什么用 B+ 树？","mysql-index-btree",{"raw":88,"autoGenerate":121},"2026-09-13T10:00:55.631382Z",[101],[],{"permalink":212,"excerpt":213,"lastModifyTime":214,"phase":130},"\u002Farchives\u002Fmysql-index-btree","一、B+ 树特点 非叶子节点只存索引，不存数据，单节点可容纳更多索引，树更矮。 叶子节点通过双向链表连接，范围查询效率高。 所有数据都在叶子节点，查询路径长度一致，性能稳定。 二、为什么不用 B 树 B 树非叶子节点也存数据，导致单节点索引少、树更高、磁盘 I\u002FO 多；范围查询需要中序遍历，效率低。","2026-09-16T09:13:47.604960Z",[216],{"metadata":217,"spec":219,"status":220,"postCount":70},{"name":101,"creationTimestamp":102,"labels":218},{"haloweb.section":104},{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},{"permalink":111,"postCount":70,"visiblePostCount":70},{"metadata":222,"spec":223,"status":227,"categories":228,"content":234},{"name":181,"creationTimestamp":182},{"title":184,"slug":185,"cover":88,"excerpt":224,"publishTime":187,"categories":225,"tags":226,"priority":24,"pinned":109,"deleted":109,"visible":125,"allowComment":121},{"raw":88,"autoGenerate":121},[101],[],{"permalink":191,"excerpt":192,"lastModifyTime":193,"phase":130},[229],{"metadata":230,"spec":232,"status":233,"postCount":70},{"name":101,"creationTimestamp":102,"labels":231},{"haloweb.section":104},{"displayName":106,"slug":101,"cover":88,"description":107,"priority":108,"hideFromList":109,"preventParentPostCascadeQuery":109},{"permalink":111,"postCount":70,"visiblePostCount":70},{"content":235,"raw":235},"\u003Ch2>一、原子性（Atomicity）\u003C\u002Fh2>\n\u003Cp>事务中的操作要么全部成功，要么全部失败回滚。由 undo log 保证：记录修改前的旧值，回滚时反向操作。\u003C\u002Fp>\n\u003Ch2>二、一致性（Consistency）\u003C\u002Fh2>\n\u003Cp>事务前后数据满足业务约束。由原子性、隔离性、持久性共同保证，是事务的最终目标。\u003C\u002Fp>\n\u003Ch2>三、隔离性（Isolation）\u003C\u002Fh2>\n\u003Cp>并发事务互不干扰。由锁机制和 MVCC 保证。\u003C\u002Fp>\n\u003Ch2>四、持久性（Durability）\u003C\u002Fh2>\n\u003Cp>事务提交后数据永久保存。由 redo log 保证：修改先写 redo log，即使宕机也能恢复。\u003C\u002Fp>\n\u003Ch2>五、InnoDB 实现\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>undo log → 原子性\u003C\u002Fli>\n\u003Cli>redo log → 持久性\u003C\u002Fli>\n\u003Cli>MVCC + 锁 → 隔离性\u003C\u002Fli>\n\u003C\u002Ful>"]