Tag

OR operator

1 views collected around this technical thread.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 2, 2024 · Databases

Does MySQL’s OR Operator Use Indexes? Experimental Findings and Optimization Tips

The article demonstrates through a practical experiment that MySQL will use indexes for an OR condition only when both operands are indexed, otherwise it falls back to a full table scan, and it suggests using UNION as an optimization when one side lacks an index.

Database performanceMySQLOR operator
0 likes · 4 min read
Does MySQL’s OR Operator Use Indexes? Experimental Findings and Optimization Tips