The SQL statement is as follows :. selectblog0 _. blogIdasblogId5 _, blog0 _. classNameasclassName5 _, blog0 _. titleastitle5 _, blog0 _. contentascontent5 _, blog0 _. createDateascreateDate5 _, blog0 _. pictureSumaspictureSum5 _, blog0 _. adminIdasadminId5_fromblogblog0 _... selectmysql index
The SQL statement is as follows:
.
Select blog0 _. blogId as blogId5 _, blog0 _. className as className5 _, blog0 _. title as title5 _, blog0 _. content as content5 _, blog0 _. createDate as createDate5 _, blog0 _. pictureSum as pictureSum5 _, blog0 _. adminId as adminId5 _ from blog blog0 _ where 1 = 1 and blog0 _. className = 1 order by blog0 _. blogId DESC limit 1, 10;
.
The index is on the className.
.
This statement can query the required data before an index is created;
.
After the index is created, the statement can only execute 0 rows;
.
Then I started to explain and found that I had taken the index but didn't get the data.
.
Replace select * with select a, B, c, d from... Then, find the problem:
.
The remark type of a column in the data table is text. if select * or select a, B, c, remark... Then, zero data entries are directly queried.
.
If the remark column is not added during select, the query can be completed normally.
.
The problem is that I cannot use the remark column or change the table to move the remark column to a new table.
.
Okay, guys. I just want to SELECT * FROMxxx_blogWhere className = 1 order by blogId desc limit; this statement can be executed normally. what can be done to solve the problem?