Home > database >  Innodb index hit a problem
Innodb index hit a problem

Time:10-07

Mysql, innodb, version 5.1.73, the RR isolation level

Table structure is as follows:
Table structure of news:
The CREATE TABLE ` news ` (
` id ` bigint (20) NOT NULL COMMENT 'id',
` number ` bigint (20) NOT NULL COMMENT 'number',
` TMP ` bigint (20) NOT NULL COMMENT 'TMP,
PRIMARY KEY (` id `),
The KEY ` number ` (` number `),
The KEY ` TMP ` (` TMP `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='test';

Insert into news (id, number, TMP) values (1,2,600);
Insert into news (id, number, TMP) values (6,5,400);
Insert into news (id, number, TMP) values (8,5,300);
Insert into news (id, number, TMP) values (10,5,500);
Insert into news (id, number, TMP) values (13,11,100);

Data A:


B:



Data more than the data A B A record,
Insert into news (id, number, TMP) values (3,4,200);
But when executing the SQL without using the index
Select * from news where number> 2 for update;
Is this why?






CodePudding user response:

A total of 6 records, & gt; Article 2 record up to 4, go index not reinvent the wheel?

CodePudding user response:

2 don't walk index, & lt; 2 go index, this point already

CodePudding user response:

U013266102
Lwjcarrot
Junction post rate: 0%
reference
after your questions answered please post.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html

8, how to give points and knot stick?
http://bbs.csdn.net/help#post_dispose
  • Related