摘要:
MySQL Internals-Index Merge优化Louis Hust0前言之前搞错了,以为Index Merge是MySQL5.6的新特性,原来不是,发现5.5也有,看了下manual,发现5.0的manual就已经存在了, 可以说是一个历史悠久的优化手段了,好吧,不管怎么样,今天就拨开其神秘的面纱,看看其内部到底如何生成这种Index Merge的计划的。 这里只详细介绍Intersect操作,对于Union和Sort-Union的具体代码,还没开始研究。1Index Merge理论基础Index Merge——索引归并,即针对一张表,同时使用多个索引进行查询,然后将各个索引查出来 阅读全文
随笔档案-2013年01月
MySQL5.6 Internals--隐藏的索引列
2013-01-27 16:56 by 心中无码, 2825 阅读, 收藏, 编辑
摘要:
MySQL5.6 Internals-隐藏的索引列Louis Hust0前言今天本来想跟踪MySQL5.6中的新特性Index Merge,结果在跟踪的过程中,发现了一个问题,即InnoDB的二级索引中 可能会包含主索引,当然这里的包含并不是说二级索引的row里面会有pk的记录,这一点是一直存在的,这里的包含 是指,二级索引也会包含主索引进行排序。1现场重现1.1初始化数据mysql>showcreatetableindex_merge\G***************************1.row***************************Table:index_merg 阅读全文
MySQL Internals--How MySQL optimize single range
2013-01-26 19:06 by 心中无码, 534 阅读, 收藏, 编辑
摘要:
MySQL Internals-How MySQL optimize single rangeLouis Hust0PerfaceWhen MySQL calculates the cost of QEP(Query execute plan), it will do a quick test for range scan with const values. But when the condition in where is complex, it should do the right thing for optimization, otherwise the exact plan ma 阅读全文
Understanding SELECT_LEX & SELECT_LEX_UNIT
2013-01-16 13:09 by 心中无码, 1057 阅读, 收藏, 编辑
摘要:
Understanding SELECT_LEX & SELECT_LEX_UNITLouis Hust0PrefaceSELECT_LEX(st_select_lex)&SELECT_LEX_UNIT(st_select_lex_unit) are two important structs in Optimizer. They are used from yacc grammer to senmantics and to optimizer at last. So they are also the basic of understanding the Optimizer. 阅读全文
Deep into MySQL QEP with optimizer_trace
2013-01-05 19:32 by 心中无码, 564 阅读, 收藏, 编辑
摘要:
Deep into MySQL QEP with optimizer_traceLouis Hust0PrefaceMySQL5.6 add a new option to show QEP more deeply-optimizer_trace. This option is very different from EXPLAIN which just showes the table access method, index using, table join order and so on. But optimizer_trace output every steps of how th 阅读全文