condition
are properly indexed.condition
only compares columns across the two tables (e.g., target.user_id=source.u_id
), not a column with a constant (e.g., source.account_status='ACTIVE'). For comparisons between columns and constants, use the
WHEN` clause.idx1
will have few hits compared to some other index, we can hint the engine to IGNORE INDEX (idx1)
.