I got question on index strategies for mysql - mainly when to use a composite index
I have a fairly common relational db scenario, heres my table set up:
Maintable - table consisting of "products" including brandid, merchantid
So I create a table to store the brands and merchants
Brandtable - brandname, brandid
Merchanttable - merchantname, merchantid
When I query the Maintable I sometimes query for brandid, sometimes for merchantid and sometimes both. What is best to use in this scenario, a single index on each column, or composite index made up of both?
Also if I wanted to include brandname and merchantname in a fulltext search, how would I achieve this?
Cheers :)