In my database, I have a table that contains a companyId, pointing to a company, and some text. I would like to do a FULLTEXT search, but as I always make requests against a specific companyId I'd like to use a composite key that combines my companyId and the fulltext index. Is there anyway to do that ? As I guess this is not possible, what is the optimal way to create indexes so that the following query is fastest ?
The request will always be
SELECT * FROM textTable
WHERE companyId = ? (Possibly more conditions) AND
MATCH(value) AGAINST("example")
Should I create my indexes on integer columns normally and add one fulltext index ? or should I include the value
column in the index ? Maybe both ?