In the following query
SELECT col1,col2
FROM table1
WHERE col3=\'value1\'
AND col4=\'value2\'
If I have 2 separate indexes one on
This is a question I hear a lot and there is a lot of confusion around the issues due to:
The differences in mySQL over the years. Indexes and multiple index support changed over the years (towards being supported)
the InnoDB / myISAM differences There are some key differences (below) but I do not believe multiple indexes are one of them
MyISAM is older but proven. Data in MyISAM tables is split between three different files for:- table format, data, and indexes.
InnoDB is relatively newer than MyISAM and is transaction safe. InnoDB also provides row-locking as opposed to table-locking which increases multi-user concurrency and performance. InnoDB also has foreign-key constraints.
Because of its row-locking feature InnoDB is well suited to high load environments.
To be sure about things, make sure to use explain_plan to analyze the query execution.