Antipattern
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
Recipes
- Find
COUNTsubqueries used as existence checks - Find
DISTINCTmasking join fan-out - Find
HAVINGconditions that use no aggregate - Find
INSERT ... VALUESstatements that omit the column list - Find
LIKEpatterns starting with a wildcard - Find
NOT INwith a subquery - Find
OFFSET-based pagination - Find
ORDER BYon a random function - Find
SELECT *queries - Find
UNIONwhereUNION ALLmay suffice - Find
UPDATEandDELETEstatements without aWHEREclause - Find cartesian joins
- Find constant predicates that are always true or always false
- Find correlated aggregate subqueries in
WHERE - Find non-sargable predicates
- Find optional filters written as
ORparameterIS NULL - Find oversized
INlists - Find row limiters without an
ORDER BY - Find scalar subqueries in the
SELECTlist - Remove redundant
ORDER BYfrom subqueries - Replace
= NULLand<> NULLwithIS NULLandIS NOT NULL