Skip to main content
Tweeted twitter.com/StackDBAs/status/1245139092582600706
added 67 characters in body; edited tags
Source Link
RolandoMySQLDBA
  • 184.4k
  • 33
  • 323
  • 531

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.The The basis is one table with a fulltext on two columns and I want to search the database but order it by either the primary (least/most recent) or popularity. 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:

See http://sqlfiddle.com/#!9/ed646c/1SQL Fiddle #1

What's very fast so far is denormalization of search columns in a separate table and a join but I would rather not have another table if not necessary. SQL Fiddle below (denormalized query at the end):

See http://sqlfiddle.com/#!9/0d6cde/1SQL Fiddle #2

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.The basis is one table with a fulltext on two columns and I want to search the database but order it by either the primary (least/most recent) or popularity. 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's very fast so far is denormalization of search columns in a separate table and a join but I would rather not have another table if not necessary. SQL Fiddle below (denormalized query at the end):

http://sqlfiddle.com/#!9/0d6cde/1

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. The basis is one table with a fulltext on two columns and I want to search the database but order it by either the primary (least/most recent) or popularity. 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:

See SQL Fiddle #1

What's very fast so far is denormalization of search columns in a separate table and a join but I would rather not have another table if not necessary. SQL Fiddle below (denormalized query at the end):

See SQL Fiddle #2

Source Link
JJJ
  • 187
  • 1
  • 8

How to make a FULLTEXT search with ORDER BY fast?

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.The basis is one table with a fulltext on two columns and I want to search the database but order it by either the primary (least/most recent) or popularity. 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's very fast so far is denormalization of search columns in a separate table and a join but I would rather not have another table if not necessary. SQL Fiddle below (denormalized query at the end):

http://sqlfiddle.com/#!9/0d6cde/1