Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table xyz
- ( id int not null,
- title varchar(1000) not null
- );
- -- truncate xyz;
- insert xyz (id,title) select qid,title from questions_mysql limit 5000;
- select sum(length(title)) from xyz;
- -- 1st time: 265416 in 0.032 sec
- -- 2nd time: 265416 in 0.015 sec
- -- 3nd time: 265416 in 0.000 sec
- -- 4th time: 265416 in 0.016 sec
- So far inconclusive due to title being cached potentially, not length(title) necess being cached
- truncate xyz;
- insert xyz (id,title) select qid,title from questions_mysql limit 5000;
- select count(*)
- from
- ( select distinct(soundex(title))
- from xyz
- )xDerived;
- -- 1st time: 4996 rows in 0.281 sec
- -- 2nd time: 4996 rows in 0.281 sec
- -- 3rd time: 4996 rows in 0.265 sec
- -- 3rd time: 4996 rows in 0.266 sec
- Granted xDerived on 5.6 is manifested in a temp table but if soundex is cached then temp is generated quicker
- select sum(length(title)) from xyz;
- -- 1st time: 265416 in 0.016 sec
- Note in above line, that is new data due to truncate.
Advertisement
Add Comment
Please, Sign In to add comment