本帖最后由 sksgod 于 2011-08-28 10:57:01 编辑

解决方案 »

  1.   

    创建 (BookName, UpTime)的复合索引
      

  2.   

    参考一下这个贴子。http://topic.csdn.net/u/20110827/17/739bd667-703b-4ca1-89ff-e625e724d00b.html
      

  3.   

    贴出你的EXPLAIN结果和所有相关表的show index from ..
      

  4.   

    1 SIMPLE novel_chapter ALL BookName 68522 Using temporary; Using filesort
    1 SIMPLE novel_booklist ref BookName BookName 130 novel.novel_chapter.BookName 1
    1 SIMPLE novel_category ALL CategoryName 8 Using where; Using join buffernovel_chapter 0 PRIMARY 1 ID A 68522 BTREE
    novel_chapter 1 BookName 1 BookName A 243 YES     BTREE
    novel_chapter 1 BookName 2 UpTime A 68522 YES BTREE
    novel_chapter 1 BookName 3 ChapterName A 68522 BTREE
    novel_chapter 1 ID 1 ID A 68522 BTREE
    novel_chapter 1 ChapterName 1 ID A 68522 BTREE
    novel_chapter 1 ChapterName 2 ChapterName A 68522 BTREE
    novel_chapter 1 ChapterName 3 Volume A 68522 YES BTREE
    novel_chapter 1 ChapterName 4 ChapterLen A 68522 YES BTREE
    novel_chapter 1 ChapterLen 1 ChapterLen A 68522 YES BTREE
    novel_chapter 1 UpTime 1 UpTime A 22840 YES BTREE
      

  5.   

    强制索引select   *
    from A  force  index(1楼的索引)
    where ...