I have a table:
ID | Name | Status
With millions of entries. If I do a select:
SELECT * from table where ID = 949442
Will this query be in any way faster than this one:
SELECT * from table where ID = 949442 AND status = "OPEN"
Assuming that this row could have an OPEN or CLOSED status?
The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `table` ADD INDEX `table_idx_id` (`ID`);
SELECT
*
FROM
table
WHERE
table.ID = 949442