29. 实例
• where date = 20111011 and name = ‘kk’
• 用了 index condition pushdown的在判断
date索引会结合name选择过滤掉没用的
record
• 注意:只有联合索引才有意义
30. 动态字段
• create table t (id int auto_increment primary key,
test mediumblob);
• insert into t (test) values (COLUMN_CREATE(1, "bt", 4, "小bt"))(2,‘小bt’,3,‘大
BT’)(1,”dd“,4,”pp“)
• select COLUMN_GET(test, 4 as char(10)), column_list(test) as list
from t where COLUMN_GET(test, 1 as char(10)) = ‘bt’;
• 结果: name list
小bt 1,4
31. 动态字段
• where date = 20111011 and name = ‘%kk
%’
• 用了 index condition pushdown会判断符
合的%kk%的条件,从而避免了符合date
的所有的记录的读取,降低了IO
• 注意:只有联合索引才有意义