<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Yihui’s Blog</title><link>https://yihuiblog.top/</link><description>前端技术笔记与工程实践</description><language>zh-CN</language><atom:link href="https://yihuiblog.top/rss.xml" rel="self" type="application/rss+xml"/><item><title>SQL与NoSQL有什么区别？MySQL和MongoDB如何选型？实际项目中如何选择？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/13-sql-vs-nosql/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/13-sql-vs-nosql/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：简单 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 MySQL与MongoDB的主要差异在数据模型、事务边界、查询方式和模式演化；按业务访问模式和一致性需求选型。 面试口语版（约 60…</description><dc:date>2026-09-30T03:25:38.032Z</dc:date><category>MySQL</category></item><item><title>UNION和UNION ALL有什么区别？性能如何？什么时候使用哪种方式？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/14-union-vs-union-all/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/14-union-vs-union-all/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 UNION会对合并结果去重，UNION ALL保留重复行，后者通常少一次去重成本。 面试口语版（约 60 秒） UNION 默认做 …</description><dc:date>2026-09-30T03:25:38.032Z</dc:date><category>MySQL</category></item><item><title>VARCHAR存储空间如何计算？内存和磁盘存储有什么差异？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/15-varchar-space/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/15-varchar-space/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 VARCHAR的磁盘占用取决于实际内容字节数、长度信息和行格式；声明上限与实际存储量不能画等号。 面试口语版（约 60 秒） VAR…</description><dc:date>2026-09-30T03:25:38.032Z</dc:date><category>MySQL</category></item><item><title>DELETE、DROP、TRUNCATE有什么区别？如何选择合适的数据删除方式？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/06-delete-drop-truncate/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/06-delete-drop-truncate/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 DELETE删行，TRUNCATE清空表，DROP移除表对象；三者在过滤能力、事务语义和结构保留上不同。 面试口语版（约 60 秒）…</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>EXISTS和IN子查询有什么区别？性能如何？如何选择合适的子查询方式？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/07-exists-vs-in/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/07-exists-vs-in/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 EXISTS 判断子查询是否至少返回一行（可以相关，也可以非相关），IN 判断值是否属于子查询结果；优化器可能将语义等价的写法改写为…</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>MySQL查询执行流程是怎样的？查询优化器是如何工作的？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/08-query-execution-optimizer/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/08-query-execution-optimizer/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 MySQL解析SQL后由优化器选择访问路径和连接顺序，再由执行器调用存储引擎获取数据并返回结果。 面试口语版（约 60 秒） 客户端…</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>MySQL缓存机制是怎样的？与Redis缓存有什么区别？如何设计缓存架构？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/09-mysql-cache-vs-redis/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/09-mysql-cache-vs-redis/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 InnoDB Buffer Pool缓存数据页以减少磁盘读取；Redis是应用侧可独立访问的数据缓存，两者位于不同层次。 面试口语版…</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>MySQL有哪些常见存储引擎？InnoDB为什么成为默认引擎？如何选择合适的存储引擎？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/10-storage-engines/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/10-storage-engines/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 MySQL存储引擎负责表数据的存取实现；InnoDB因事务、行级锁、崩溃恢复和外键等能力成为多数业务表的默认选择。 面试口语版（约 …</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>MySQL有哪些约束类型？各自的业务作用是什么？如何选择合适的约束策略？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/11-mysql-constraints/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/11-mysql-constraints/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 约束把数据完整性要求放进数据库，包括主键、唯一、非空、外键和检查约束等。 面试口语版（约 60 秒） 约束是数据库层最后一道数据完整…</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>NULL值在MySQL中是如何处理的？对查询有什么影响？如何正确处理NULL值？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/12-null-semantics/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/12-null-semantics/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 NULL表示未知或缺失，比较表达式会进入三值逻辑；查询应使用IS NULL而不是等号判断。 面试口语版（约 60 秒） NULL 表…</description><dc:date>2026-09-30T03:25:38.031Z</dc:date><category>MySQL</category></item><item><title>内连接与外连接有什么区别？ON和WHERE条件在连接查询中有什么不同？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/02-join-on-where/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/02-join-on-where/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：根据可访问的题目详情改写 一句话答案 内连接只保留匹配行；外连接会保留指定一侧的未匹配行，因此ON与WHERE在外连接中可能产生不同结果。 面试口语版（约 60 秒） 内连接只返回能匹配的组合；左…</description><dc:date>2026-09-30T03:25:38.030Z</dc:date><category>MySQL</category></item><item><title>什么是分库分表？何时需要进行分库分表？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/01-sharding-when/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/01-sharding-when/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：根据可访问的题目详情改写 一句话答案 分库分表是按业务或数据行分散存储与负载的手段，应在确认单库瓶颈且索引、SQL、归档等常规优化不足时考虑。 面试口语版（约 60 秒） 我会先区分垂直拆分和水平…</description><dc:date>2026-09-30T03:25:38.030Z</dc:date><category>MySQL</category></item><item><title>数据库三大范式是什么？实际项目中如何平衡范式化和反范式化？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/03-normalization/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/03-normalization/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：根据可访问的题目详情改写 一句话答案 1NF强调字段原子性，2NF消除对复合键的部分依赖，3NF消除非主属性间的传递依赖；反范式化是有代价的性能取舍。 面试口语版（约 60 秒） 1NF 要求列值…</description><dc:date>2026-09-30T03:25:38.030Z</dc:date><category>MySQL</category></item><item><title>CHAR和VARCHAR有什么区别？如何选择字符串类型？存储空间如何计算？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/04-char-varchar/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/04-char-varchar/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：根据可访问的题目详情改写 一句话答案 CHAR是固定声明长度的字符类型，VARCHAR按实际内容占用可变长度并带长度信息；选择时以数据分布和字符集为准。 面试口语版（约 60 秒） CHAR(N)…</description><dc:date>2026-09-30T03:25:38.030Z</dc:date><category>MySQL</category></item><item><title>COUNT函数有哪些使用方式？性能有什么区别？如何优化COUNT查询？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/05-count-usage/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/05-count-usage/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：根据可访问的题目详情改写 一句话答案 COUNT()统计行数，COUNT(列)统计该列非NULL的行，COUNT(DISTINCT 列)统计非NULL去重值；精确计数通常仍需扫描索引。 面试口语版…</description><dc:date>2026-09-30T03:25:38.030Z</dc:date><category>MySQL</category></item><item><title>分库分表后会产生哪些问题？如何解决跨库查询和分布式事务？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/38-sharding-aftereffects/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/38-sharding-aftereffects/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：困难 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 分片能分散数据和写负载，却把单库的查询、约束和事务边界拆开；先用分片键让高频操作落在同一片，再为跨片查询和写入分别选择汇总索引、XA…</description><dc:date>2026-09-30T03:25:13.246Z</dc:date><category>MySQL</category></item><item><title>MySQL主从复制有哪些延迟问题？如何解决数据延迟？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/44-replication-lag/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/44-replication-lag/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 复制延迟要区分源库产生 binlog、从库接收 relay log 和从库回放提交三个阶段；先找到积压位置，再分别治理写入峰值、网络…</description><dc:date>2026-09-30T03:25:13.246Z</dc:date><category>MySQL</category></item><item><title>什么是binlog？binlog的作用和工作原理是什么？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/25-binlog/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/25-binlog/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 binlog 是 MySQL 服务端记录数据变更事件的顺序日志，主要服务复制与全量备份后的时间点恢复。 30–90 秒口语版 源库把…</description><dc:date>2026-09-30T03:24:17.342Z</dc:date><category>MySQL</category></item><item><title>MySQL日志刷盘策略有哪些？如何平衡性能与安全性？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/29-mysql-log-flush/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/29-mysql-log-flush/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 关键是分别控制 InnoDB redo 与服务端 binlog 的同步：高持久性通常取 innodbflushlogattrxcom…</description><dc:date>2026-09-30T03:23:06.264Z</dc:date><category>MySQL</category></item><item><title>什么是undo log？undo log如何实现事务回滚和MVCC？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/27-undo-log/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/27-undo-log/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 undo log 保存撤销修改所需的信息；事务回滚用它还原，MVCC 一致性读用它构造可见的旧版本。 30–90 秒口语版 Inno…</description><dc:date>2026-09-30T03:23:06.263Z</dc:date><category>MySQL</category></item><item><title>binlog与redo log有什么区别？两阶段提交如何保证一致性？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/28-binlog-redo-two-phase/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/28-binlog-redo-two-phase/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 redo 服务 InnoDB 崩溃恢复，binlog 服务复制和时间点恢复；内部提交协调使崩溃时可根据 binlog 中的事务标识决…</description><dc:date>2026-09-30T03:23:06.263Z</dc:date><category>MySQL</category></item><item><title>什么是redo log？redo log如何保证事务的持久性？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/26-redo-log/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/26-redo-log/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 redo log 是 InnoDB 的预写式重做日志：提交时先确保持久化所需日志，脏数据页可稍后落盘；崩溃时从检查点后重放并配合事务…</description><dc:date>2026-09-30T03:23:06.262Z</dc:date><category>MySQL</category></item><item><title>日志文件过大如何处理？日志清理和归档策略是什么？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/24-mysql-log-retention/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/24-mysql-log-retention/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：困难 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 先分清 binlog、慢日志、错误日志、redo 与 undo，再按照复制追赶、备份恢复和审计窗口处理；只通过各自受支持的机制轮转、…</description><dc:date>2026-09-30T03:23:06.261Z</dc:date><category>MySQL</category></item><item><title>索引的维护成本有哪些？如何监控索引效果？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/22-index-maintenance-cost/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/22-index-maintenance-cost/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 索引的收益要减去空间、DML 维护和优化器选择成本；用慢查询、执行计划与长期索引使用统计评估，清理前验证业务覆盖。 30–90 秒口…</description><dc:date>2026-09-30T03:23:06.261Z</dc:date><category>MySQL</category></item><item><title>MySQL有哪些索引类型？如何正确设计索引？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/23-mysql-index-types/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/23-mysql-index-types/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 先按业务约束选主键、唯一或普通索引，再按查询形态选单列、联合、前缀、全文或空间索引；对 InnoDB 的常规查找主要依赖 B-tre…</description><dc:date>2026-09-30T03:23:06.261Z</dc:date><category>MySQL</category></item><item><title>什么是索引？为什么B+树是MySQL的主流选择？索引如何提升查询性能？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/20-bplus-index/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/20-bplus-index/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 索引是按键值组织的访问路径；InnoDB 以 B-tree 索引支持等值、范围和有序遍历，减少不必要的数据页访问。 30–90 秒口…</description><dc:date>2026-09-30T03:23:06.260Z</dc:date><category>MySQL</category></item><item><title>什么是最左前缀原则？复合索引如何优化查询性能？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/21-leftmost-prefix/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/21-leftmost-prefix/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 联合索引按定义的列序排列，连续左侧键值可用于高效定位；后续列仍可能用于过滤、覆盖或排序，不能机械地说“范围后全部失效”。 30–90…</description><dc:date>2026-09-30T03:23:06.260Z</dc:date><category>MySQL</category></item><item><title>什么情况下索引会失效？如何通过EXPLAIN分析索引性能？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/18-index-not-used-explain/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/18-index-not-used-explain/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 “索引失效”不是一种单一状态：可能无法做索引范围定位、可以扫索引但仍回表，也可能优化器算出全表扫描更便宜；用执行计划和实测定位。 3…</description><dc:date>2026-09-30T03:23:06.259Z</dc:date><category>MySQL</category></item><item><title>什么是覆盖索引？索引下推如何优化查询？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/19-covering-index-icp/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/19-covering-index-icp/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 覆盖索引使查询所需列都可从索引取得；ICP 则在扫描索引时先判断可由索引项计算的条件，减少不必要的基表读取，两者不是同一优化。 30…</description><dc:date>2026-09-30T03:23:06.259Z</dc:date><category>MySQL</category></item><item><title>分页查询、排序、模糊查询如何进行索引优化？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/17-pagination-sort-like-index/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/17-pagination-sort-like-index/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 把等值过滤、稳定排序和分页游标放在同一访问路径上；LIKE &apos;前缀%&apos;可尝试范围查找，LIKE &apos;%词%&apos;不能按普通 B-tree …</description><dc:date>2026-09-30T03:23:06.258Z</dc:date><category>MySQL</category></item><item><title>WHERE和HAVING有什么区别？什么时候使用HAVING？如何优化分组查询？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/16-where-vs-having/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/16-where-vs-having/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：简单 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 WHERE在分组前筛选原始行，HAVING在分组后筛选分组结果，聚合条件通常写在HAVING。 面试口语版（约 60 秒） WHER…</description><dc:date>2026-09-30T03:23:06.258Z</dc:date><category>MySQL</category></item><item><title>读写分离如何实现？有什么注意事项？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/37-read-write-splitting/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/37-read-write-splitting/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 读写分离通过应用或代理将写入路由到主库、可容忍延迟的读取路由到副本；核心难点是复制延迟下的读一致性、事务路由和故障切换。 面试口语版…</description><dc:date>2026-09-30T03:22:36.504Z</dc:date><category>MySQL</category></item><item><title>什么是MVCC？MVCC如何实现事务的隔离性？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/33-mvcc/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/33-mvcc/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 MVCC 利用行的历史版本和事务可见性规则提供一致性读，让普通查询能读取合适版本而不必等待并发写入。 面试口语版（约 60 秒） “…</description><dc:date>2026-09-30T03:22:36.503Z</dc:date><category>MySQL</category></item><item><title>Gap锁和Next-Key锁的作用是什么？如何解决幻读问题？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/34-gap-next-key-locks/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/34-gap-next-key-locks/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 Gap 锁限制索引间隙的新插入，Next-Key 锁是记录锁加其前方 Gap 锁；在 InnoDB RR 的范围锁定读或更新中，它们…</description><dc:date>2026-09-30T03:22:36.503Z</dc:date><category>MySQL</category></item><item><title>MySQL有哪些事务隔离级别？各自解决什么问题？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/35-isolation-levels/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/35-isolation-levels/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 InnoDB 提供 RU、RC、RR、Serializable 四级隔离，逐级约束并发可见性与锁行为；默认 RR，选型还要看读类型和…</description><dc:date>2026-09-30T03:22:36.503Z</dc:date><category>MySQL</category></item><item><title>MySQL有哪些锁类型？行锁、表锁、意向锁的作用是什么？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/36-mysql-lock-types/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/36-mysql-lock-types/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：简单 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 InnoDB 用表级意向锁协调表锁与行锁，并在索引记录上使用共享/排他、记录、Gap、Next-Key 等锁；“行锁”实际与索引访问…</description><dc:date>2026-09-30T03:22:36.503Z</dc:date><category>MySQL</category></item><item><title>乐观锁和悲观锁有什么区别？在什么场景下使用？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/30-optimistic-pessimistic-lock/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/30-optimistic-pessimistic-lock/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 悲观锁先取得数据库锁再操作；乐观锁在提交更新时用版本或条件校验冲突，两者分别适合高冲突短事务与低冲突、可处理失败的场景。 面试口语版…</description><dc:date>2026-09-30T03:22:36.502Z</dc:date><category>MySQL</category></item><item><title>什么是事务？事务的ACID特性如何理解？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/31-transaction-acid/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/31-transaction-acid/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 事务是一次提交或回滚的工作单元；ACID 描述其原子性、一致性、隔离性和持久性，但业务一致性仍要靠正确的约束与事务逻辑。 面试口语版…</description><dc:date>2026-09-30T03:22:36.502Z</dc:date><category>MySQL</category></item><item><title>什么是死锁？如何检测和预防死锁？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/32-deadlock/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/32-deadlock/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 死锁是多个事务形成环形锁等待；InnoDB 通常检测后回滚一个事务，应用应重试整个事务，并通过一致加锁顺序、短事务和合适索引降低发生…</description><dc:date>2026-09-30T03:22:36.502Z</dc:date><category>MySQL</category></item><item><title>MySQL主库故障如何处理？故障切换的方案有哪些？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/45-primary-failover/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/45-primary-failover/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 先判定故障并阻断旧主写入，再核对候选副本事务完整性、提升新主并切换应用路由；切换后的数据差异、旧主重加入和业务重试必须单独处理。 面…</description><dc:date>2026-09-30T03:22:16.222Z</dc:date><category>MySQL</category></item><item><title>深分页查询如何优化？LIMIT大偏移量的性能问题如何解决？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/41-deep-pagination/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/41-deep-pagination/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：困难 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 大偏移量 LIMIT 仍需定位并跳过前面的记录；连续翻页用与排序索引一致的键集游标，任意页跳转则控制范围或设计专用读模型。 面试口语…</description><dc:date>2026-09-30T03:22:16.221Z</dc:date><category>MySQL</category></item><item><title>什么是MySQL主从复制？主从复制的完整过程是怎样的？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/42-replication-process/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/42-replication-process/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：中等 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 MySQL 复制按“源库写 binlog → 从库 receiver 接收并写 relay log → applier 回放提交”运…</description><dc:date>2026-09-30T03:22:16.221Z</dc:date><category>MySQL</category></item><item><title>MySQL配置参数如何调优？关键参数对性能的影响是什么？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/43-mysql-config-tuning/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/43-mysql-config-tuning/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：困难 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 参数调优先找实测瓶颈，再在内存、连接并发、I/O 与持久性目标之间取舍；任何参数都要结合 MySQL 版本、实例角色和真实负载验证。…</description><dc:date>2026-09-30T03:22:16.221Z</dc:date><category>MySQL</category></item><item><title>如何分析和优化慢SQL？慢查询的常见原因有哪些？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/39-slow-sql/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/39-slow-sql/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：困难 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 先用延迟、频次和等待信息锁定具体 SQL 与瓶颈，再用执行计划和实际执行数据验证假设；按扫描、排序、锁或资源原因改动，并用同一工作负…</description><dc:date>2026-09-30T03:22:16.220Z</dc:date><category>MySQL</category></item><item><title>如何进行MySQL性能监控？关键性能指标有哪些？</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/40-mysql-monitoring/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/40-mysql-monitoring/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 难度：困难 来源：牛面 MySQL 题库 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 MySQL 监控要把业务请求延迟与数据库内部等待、吞吐、资源和复制状态连起来看；单一 QPS、连接数或“复制延迟秒数”不足以解释故障…</description><dc:date>2026-09-30T03:22:16.220Z</dc:date><category>MySQL</category></item><item><title>MySQL 面试题库</title><link>https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/README/</link><guid isPermaLink="true">https://yihuiblog.top/posts/MySQL/%E9%9D%A2%E8%AF%95%E9%A2%98/README/</guid><description>日期：2026-09-27 标签：#面试 #MySQL #数据库 题目和难度采集自牛面 MySQL 题库。45 题均已扩写为可复习的参考答案；前 5 道可访问题在原改写基础上补充，40 道 VIP 题为独立整理，未读取站内会员答案。 阅读路线 基础与 SQL（01–16）：表结构、类型、连接、聚合与查询语义。先能…</description><dc:date>2026-09-27T07:46:39.287Z</dc:date><category>MySQL</category></item><item><title>如何为Redis分布式锁设置合理的超时时间？</title><link>https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/05-redis-lock-timeout/</link><guid isPermaLink="true">https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/05-redis-lock-timeout/</guid><description>日期：2026-09-27 标签：#面试 #场景设计 #Redis 难度：中等 来源：牛面场景题 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 租约应覆盖可预期的执行、暂停与网络抖动，同时限制故障后的等待；没有可靠耗时上界时用有身份校验的受控续期，并在业务资源侧防止旧执行者写入。 面试…</description><dc:date>2026-09-27T07:06:26.222Z</dc:date><category>场景面试题</category></item><item><title>怎么用Redis实现可重入的分布式锁？</title><link>https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/12-redis-reentrant-lock/</link><guid isPermaLink="true">https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/12-redis-reentrant-lock/</guid><description>日期：2026-09-27 标签：#面试 #场景设计 #Redis 难度：中等 来源：牛面场景题 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 为同一把锁保存“本次最外层获锁的唯一令牌 + 重入次数 + 租约”；嵌套调用共享该令牌并原子递增，释放时递减，次数归零才删除。新一轮独立获锁必…</description><dc:date>2026-09-27T07:05:55.552Z</dc:date><category>场景面试题</category></item><item><title>基于 Redis 实现分布式锁有什么优缺点？</title><link>https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/04-redis-lock-pros-cons/</link><guid isPermaLink="true">https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/04-redis-lock-pros-cons/</guid><description>日期：2026-09-27 标签：#面试 #场景设计 #Redis 难度：简单 来源：牛面场景题 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 Redis 锁接入简单、响应快，适合容忍少量故障窗口内重复执行的任务；租约过期与主从切换可能破坏互斥，关键写入还须在资源侧拒绝旧持有者。 面试…</description><dc:date>2026-09-27T07:05:14.489Z</dc:date><category>场景面试题</category></item><item><title>MySQL主从复制有哪些延迟问题？如何解决数据延迟？</title><link>https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/27-mysql-replication-lag/</link><guid isPermaLink="true">https://yihuiblog.top/posts/%E5%9C%BA%E6%99%AF%E9%9D%A2%E8%AF%95%E9%A2%98/27-mysql-replication-lag/</guid><description>日期：2026-09-27 标签：#面试 #场景设计 #MySQL 难度：中等 来源：牛面场景题 答案说明：独立整理（站内题目标记为 VIP，未读取会员答案） 一句话答案 复制延迟要区分源库产生 binlog、从库接收 relay log 和从库回放提交三个阶段；先找到积压位置，再分别治理写入峰值、网络或回放瓶颈…</description><dc:date>2026-09-27T07:04:56.423Z</dc:date><category>场景面试题</category></item></channel></rss>