Table structure is simple
CREATE TABLE ' oplogs ' (
' id ' int (a) unsigned NOT null auto_increment,
' kind ' varchar (=) NOT null DEFAULT ',
' op ' varchar NOT NULL,
' user ' varchar ' is not null default ',
' IP ' varchar ' is not null default ',
' up DateTime ' timestamp not NULL DEFAULT current_timestamp on UPDATE current_timestamp,
PRIMARY KEY (' id ')
engine=m Yisam auto_increment=34896 DEFAULT Charset=utf8 row_format=fixed
The result is 34,895
The SQL query statement is:
Select A.id,a.kind,a.op,a.user,a.ip,a.updatetime from Oplogs as a INNER join (select ID to oplogs where 1 order by ID des C limit 0,20) as B using (ID)
In the case of 5.6.19
Read content in PHP and display
3.5 seconds to show results first
But the same configuration
Under Linux under 5.5.38
It only takes about 0.7 seconds.
It's a strange situation.
The explain results were then executed under 5.6, as follows:
And the same data explain structure is as follows:
Comparison results are obviously mainly in the sort of oplogs, rows changed too much, a complete traversal, the first use of the index, resulting in the gap is too large, but the reason has not been found, who knows?