问题
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