Oscar Yen wrote:
create table a (
  imgid int not null,
  parent int,
  imgtype char(3),
  img longtext,
  primary key (imgid),
  key searchkey (parent, imgid)
) type = innodb;


T1) select imgid, parent from a where parent = 10;
   returns 3357 rows in 0.08 sec.
T2) select imgid, parent, imgtype from a where parent = 10;
   return 3357 rows in 8.32 sec.!!!



T7) After change the searchkey to (parent, imgid, imgtype), T1/T2, T3/T4 runs in almost same speed.


Anybody can explain my questions:

Q1- What cause the slow down, T2 vs T1 and T4 vs T3?
Q2- Can I assume mysql pooly handled on large BLOB data, by comparing performance of 
T6 and T4?

Best Reguards.

Q1:
It's explained in the MySQL Documentation under Optimization - How MySQL Uses Indexes. See http://www.mysql.com/doc/en/MySQL_indexes.html and pay close attention to the 5th bullet. This explains the behavior you see from T7.


Q2:
I have no answer for you there, Sorry.


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to