[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-config":3,"primary-menu":6,"cat-mysql":85,"catposts-mysql":98,"post-detail-post-mysql-index-btree-61981a83":207},{"config":4,"socialLinks":5},null,[],{"metadata":7,"spec":10,"menuItems":20},{"name":8,"creationTimestamp":9},"primary","2026-09-12T06:13:55.024154Z",{"displayName":11,"menuItems":12},"主菜单",[13,14,15,16,17,18,19],"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",[21,30,40,49,58,67,76],{"displayName":22,"metadata":23,"spec":25,"status":28,"children":29},"首页",{"name":13,"creationTimestamp":24},"2026-09-12T06:13:54.422830Z",{"displayName":22,"href":26,"priority":27,"menuName":8},"\u002F",0,{"displayName":22,"href":26},[],{"displayName":31,"metadata":32,"spec":34,"status":38,"children":39},"Java面试八股",{"name":14,"creationTimestamp":33},"2026-09-13T09:42:02.854891Z",{"displayName":31,"href":35,"target":36,"priority":37,"menuName":8},"\u002Fjava-interview","_self",1,{"displayName":31,"href":35},[],{"displayName":41,"metadata":42,"spec":44,"status":47,"children":48},"文章",{"name":15,"creationTimestamp":43},"2026-09-12T06:13:54.457307Z",{"displayName":41,"href":45,"priority":46,"menuName":8},"\u002Farchives",2,{"displayName":41,"href":45},[],{"displayName":50,"metadata":51,"spec":53,"status":56,"children":57},"项目实战",{"name":16,"creationTimestamp":52},"2026-09-14T00:35:08.138170Z",{"displayName":50,"href":54,"target":36,"priority":55,"menuName":8},"\u002Fcolumn",3,{"displayName":50,"href":54},[],{"displayName":59,"metadata":60,"spec":62,"status":65,"children":66},"在线工具",{"name":17,"creationTimestamp":61},"2026-09-14T00:35:08.171474Z",{"displayName":59,"href":63,"target":36,"priority":64,"menuName":8},"\u002Ftools",4,{"displayName":59,"href":63},[],{"displayName":68,"metadata":69,"spec":71,"status":74,"children":75},"知识星球",{"name":18,"creationTimestamp":70},"2026-09-14T00:35:08.199145Z",{"displayName":68,"href":72,"target":36,"priority":73,"menuName":8},"\u002Fzsxq",5,{"displayName":68,"href":72},[],{"displayName":77,"metadata":78,"spec":80,"status":83,"children":84},"特价云服务器",{"name":19,"creationTimestamp":79},"2026-09-25T15:30:59.201614Z",{"displayName":77,"href":81,"target":36,"priority":82,"menuName":8},"\u002Fserver",6,{"displayName":77,"href":81},[],{"metadata":86,"spec":91,"status":96,"postCount":73},{"name":87,"creationTimestamp":88,"labels":89},"mysql","2026-09-13T09:13:25.545156Z",{"haloweb.section":90},"interview",{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},"MySQL 面试题","","MySQL 面试题：索引原理、事务隔离、锁机制、SQL 调优、日志体系与分库分表。",false,{"permalink":97,"postCount":73,"visiblePostCount":73},"\u002Fcategories\u002Fmysql",[99,123,144,165,186],{"metadata":100,"spec":103,"status":112,"categories":117},{"name":101,"creationTimestamp":102},"post-mysql-slow-sql-72d516f1","2026-09-13T10:00:56.554547Z",{"title":104,"slug":105,"cover":93,"excerpt":106,"publishTime":108,"categories":109,"tags":110,"priority":27,"pinned":95,"deleted":95,"visible":111,"allowComment":107},"如何排查和优化慢 SQL？","mysql-slow-sql",{"raw":93,"autoGenerate":107},true,"2026-09-13T10:00:56.602215Z",[87],[],"PUBLIC",{"permalink":113,"excerpt":114,"lastModifyTime":115,"phase":116},"\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",[118],{"metadata":119,"spec":121,"status":122,"postCount":73},{"name":87,"creationTimestamp":88,"labels":120},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},{"permalink":97,"postCount":73,"visiblePostCount":73},{"metadata":124,"spec":127,"status":134,"categories":138},{"name":125,"creationTimestamp":126},"post-mysql-mvcc-6bac3675","2026-09-13T10:00:56.263936Z",{"title":128,"slug":129,"cover":93,"excerpt":130,"publishTime":131,"categories":132,"tags":133,"priority":27,"pinned":95,"deleted":95,"visible":111,"allowComment":107},"什么是 MVCC？","mysql-mvcc",{"raw":93,"autoGenerate":107},"2026-09-13T10:00:56.441642Z",[87],[],{"permalink":135,"excerpt":136,"lastModifyTime":137,"phase":116},"\u002Farchives\u002Fmysql-mvcc","一、定义 MVCC（Multi-Version Concurrency Control，多版本并发控制），通过维护数据的多个历史版本，实现读写不阻塞，提高并发性能。 二、实现要素 隐藏字段：每行有 trx_id（创建该版本的事务 ID）和 roll_pointer（指向 undo log 中的上一版","2026-09-16T09:13:48.546617Z",[139],{"metadata":140,"spec":142,"status":143,"postCount":73},{"name":87,"creationTimestamp":88,"labels":141},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},{"permalink":97,"postCount":73,"visiblePostCount":73},{"metadata":145,"spec":148,"status":155,"categories":159},{"name":146,"creationTimestamp":147},"post-mysql-isolation-levels-38ba7e64","2026-09-13T10:00:55.948391Z",{"title":149,"slug":150,"cover":93,"excerpt":151,"publishTime":152,"categories":153,"tags":154,"priority":27,"pinned":95,"deleted":95,"visible":111,"allowComment":107},"MySQL 的四种事务隔离级别？","mysql-isolation-levels",{"raw":93,"autoGenerate":107},"2026-09-13T10:00:56.137691Z",[87],[],{"permalink":156,"excerpt":157,"lastModifyTime":158,"phase":116},"\u002Farchives\u002Fmysql-isolation-levels","一、四种级别（由低到高） 隔离级别 脏读 不可重复读 幻读 READ UNCOMMITTED 可能 可能 可能 READ COMMITTED 否 可能 可能 REPEATABLE READ（InnoDB 默认） 否 否 否（间隙锁） SERIALIZABLE 否 否 否 二、问题解释 脏读：读到其他","2026-09-16T09:13:49.485728Z",[160],{"metadata":161,"spec":163,"status":164,"postCount":73},{"name":87,"creationTimestamp":88,"labels":162},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},{"permalink":97,"postCount":73,"visiblePostCount":73},{"metadata":166,"spec":169,"status":176,"categories":180},{"name":167,"creationTimestamp":168},"post-mysql-transaction-acid-5795447c","2026-09-13T10:00:55.754027Z",{"title":170,"slug":171,"cover":93,"excerpt":172,"publishTime":173,"categories":174,"tags":175,"priority":27,"pinned":95,"deleted":95,"visible":111,"allowComment":107},"事务的 ACID 特性是什么？","mysql-transaction-acid",{"raw":93,"autoGenerate":107},"2026-09-13T10:00:55.826031Z",[87],[],{"permalink":177,"excerpt":178,"lastModifyTime":179,"phase":116},"\u002Farchives\u002Fmysql-transaction-acid","一、原子性（Atomicity） 事务中的操作要么全部成功，要么全部失败回滚。由 undo log 保证：记录修改前的旧值，回滚时反向操作。 二、一致性（Consistency） 事务前后数据满足业务约束。由原子性、隔离性、持久性共同保证，是事务的最终目标。 三、隔离性（Isolation） 并发事","2026-09-16T09:13:49.020776Z",[181],{"metadata":182,"spec":184,"status":185,"postCount":73},{"name":87,"creationTimestamp":88,"labels":183},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},{"permalink":97,"postCount":73,"visiblePostCount":73},{"metadata":187,"spec":190,"status":197,"categories":201},{"name":188,"creationTimestamp":189},"post-mysql-index-btree-61981a83","2026-09-13T10:00:55.574621Z",{"title":191,"slug":192,"cover":93,"excerpt":193,"publishTime":194,"categories":195,"tags":196,"priority":27,"pinned":95,"deleted":95,"visible":111,"allowComment":107},"MySQL 索引为什么用 B+ 树？","mysql-index-btree",{"raw":93,"autoGenerate":107},"2026-09-13T10:00:55.631382Z",[87],[],{"permalink":198,"excerpt":199,"lastModifyTime":200,"phase":116},"\u002Farchives\u002Fmysql-index-btree","一、B+ 树特点 非叶子节点只存索引，不存数据，单节点可容纳更多索引，树更矮。 叶子节点通过双向链表连接，范围查询效率高。 所有数据都在叶子节点，查询路径长度一致，性能稳定。 二、为什么不用 B 树 B 树非叶子节点也存数据，导致单节点索引少、树更高、磁盘 I\u002FO 多；范围查询需要中序遍历，效率低。","2026-09-16T09:13:47.604960Z",[202],{"metadata":203,"spec":205,"status":206,"postCount":73},{"name":87,"creationTimestamp":88,"labels":204},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},{"permalink":97,"postCount":73,"visiblePostCount":73},{"metadata":208,"spec":209,"status":213,"categories":214,"content":220},{"name":188,"creationTimestamp":189},{"title":191,"slug":192,"cover":93,"excerpt":210,"publishTime":194,"categories":211,"tags":212,"priority":27,"pinned":95,"deleted":95,"visible":111,"allowComment":107},{"raw":93,"autoGenerate":107},[87],[],{"permalink":198,"excerpt":199,"lastModifyTime":200,"phase":116},[215],{"metadata":216,"spec":218,"status":219,"postCount":73},{"name":87,"creationTimestamp":88,"labels":217},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":46,"hideFromList":95,"preventParentPostCascadeQuery":95},{"permalink":97,"postCount":73,"visiblePostCount":73},{"content":221,"raw":221},"\u003Ch2>一、B+ 树特点\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>非叶子节点只存索引，不存数据，单节点可容纳更多索引，树更矮。\u003C\u002Fli>\n\u003Cli>叶子节点通过双向链表连接，范围查询效率高。\u003C\u002Fli>\n\u003Cli>所有数据都在叶子节点，查询路径长度一致，性能稳定。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>二、为什么不用 B 树\u003C\u002Fh2>\n\u003Cp>B 树非叶子节点也存数据，导致单节点索引少、树更高、磁盘 I\u002FO 多；范围查询需要中序遍历，效率低。\u003C\u002Fp>\n\u003Ch2>三、为什么不用哈希\u003C\u002Fh2>\n\u003Cp>哈希等值查询 O(1)，但不支持范围查询、排序、模糊查询，数据库这些场景很多。\u003C\u002Fp>\n\u003Ch2>四、为什么不用红黑树\u003C\u002Fh2>\n\u003Cp>红黑树是二叉树，节点只有两个子节点，数据量大时树很高，磁盘 I\u002FO 次数多。B+ 树是多叉，矮胖，适合磁盘存储。\u003C\u002Fp>"]