Skip to main content

Cost, Cardinality & Slow Queries

Learn Cost, Cardinality & Slow Queries (Query Optimization, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Introduction The optimizer is cost-based : it estimates the cost of alternative plans using statistics ( cardinality , row counts) and constants for I/O and CPU, then picks the cheapest. The slow query log records statements slower than long_query_time .

More lessons in Query Optimization