I would suggest the following solution by creating a table with complex_alias_field. This slightly increases your data, and your data is now redundant, but I find this a simple simple solution.
1. Create a table
CREATE TABLE `CompanyMaster` ( `CompUID` int(11) NOT NULL AUTO_INCREMENT, `Weburl` varchar(150) DEFAULT NULL, `CompanyName` varchar(200) DEFAULT NULL, `Alias1` varchar(150) DEFAULT NULL, `Alias2` varchar(150) DEFAULT NULL, `Alias3` varchar(150) DEFAULT NULL, `Alias4` varchar(150) DEFAULT NULL, `Created` datetime DEFAULT NULL, `LastModified` datetime DEFAULT NULL, `ComplexAliasQuery` BOOLEAN DEFAULT FALSE, PRIMARY KEY (`CompUID`), KEY `Alias` (`Alias1`,`Alias2`,`Alias3`,`Alias4`), KEY `AliasQuery` (`ComplexAliasQuery`) ) ENGINE=InnoDB AUTO_INCREMENT=5457968 DEFAULT CHARSET=latin1;
2. Complete your new Field ComplexAliasQuery
UPDATE CompanyMaster set ComplexAliasQuery = TRUE WHERE (Alias1='match1' AND Alias2='match2' )OR Alias3='match3' OR Alias4='match4';
3. To update one of the fields Alias1, Alias2, Alias3, Alias4
To update, simply fill out ComplexAliasQuery. You can do this, perhaps with Trigger http://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html or in your code if you cannot use a trigger because you are using a cluster .
4. Your simple request is at the end
SELECT CompUID,Weburl FROM `CompanyMaster` WHERE ComplexAliasQuery IS TRUE;
with clicking on the index
+----+-------------+---------------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+---------------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | CompanyMaster | ALL | NULL | NULL | NULL | NULL | 1 | Using where | +----+-------------+---------------+------+---------------+------+---------+------+------+-------------+
Another solution
If you do not like the field in your CompanyMaster table, you can transfer it to a new table and name it IndexAliasCompanyMaster, and then simply join this table.