AreWeThereYet
-
2025 = (20 + 25)² = 1 + 3 + 5 + … + 89 = 1³ + 2³ + 3³ + … + 9³
-
Check out these 2 queries:
Query 1:
SELECT ...
FROM t1
JOIN t2 ON t1.id IN (t2.id1, t2.id2);Query 2:
SELECT ...
FROM t1
JOIN t2 ON t1.id = t2.id1
UNION
SELECT ...
FROM t1
JOIN t2 ON t1.id = t2.id2;They both return the same data but since most database engines struggle with OR joins, the latter will outperform the former by at least an order of magnitude.