How to make a FULLTEXT search with ORDER BY fast?

自作多情 提交于 2020-01-07 11:13:51

问题


I'm trying to get a simple FULLTEXT match to be faster when using order by on another column on a table with over 100 million rows. Is it possible to make a FULLTEXT with an order by on another indexed column fast? SQL Fiddle below with schema and explains of all queries:

http://sqlfiddle.com/#!9/ed646c/1

What I have so far is denormalization and a join but this requires a separate table and I would rather not have another table if not necessary. SQL Fiddle below (denormalized query at the end):

http://sqlfiddle.com/#!9/6aabf/8

I'm open to schema changes or, if I have to, a full search engine on top.


回答1:


You don't need two copies of the same data; you can "self join" for the "denormalized" case.



来源:https://stackoverflow.com/questions/38690155/how-to-make-a-fulltext-search-with-order-by-fast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!