Query failure after selecting-Mysql index addition

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.