本文共 1919 字,大约阅读时间需要 6 分钟。
int型不超过1000w,含char则不超过500w; `name` char(32) default null `age` int not null default 0 索引一定不是越多越好(能不加就不加,要加的一定得加); select id where age +1 = 10; 如果不指定主键,innodb会使用唯一且非空值索引代替; select id from t where phone=’159′ or phone=’136′; select id from t where phone in (’159′, ’136′); select id from t where phone = ’159′ or name = ‘john’; select id from t where phone=’159′ select id from t where name=’jonh’ select id from t limit 10000, 10; select id from t where id > 10000 limit 10; show query_response_time(percona); 转载地址:http://aheel.baihongyu.com/