I have a table like this:
// posts
+----+-------------+-----------------------------+
| id | title | body |
+----+-------------+-----------------------------+
| 1 | First Post | The content of first post |
| 2 | Second Post | The content of second post |
+----+-------------+-----------------------------+
Now I need to search into both title
and body
columns. Noted that I want to search into those two columns as full-text.
My question: Do I need to make either one composite index on those two columns or two single indexes on them separately?
In other word, which one?
- index:
tb(title,body)
| query:WHERE MATCH(title,body) AGAINST(?,?)
- index:
t(title), b(body)
| query:WHERE MATCH(title) AGAINST(?) OR MATCH(body) AGAINST(?)
Honestly I cannot understand the different of these ^.
Also yeah I know, the title of my question isn't matched with the content.