A hands-on, vendor-neutral guide to making SQL queries fast and *keeping* them fast. Not a reference manual to memorize — a set of runnable `.sql` files and field-tested runbooks that teach the one lo
Browse the actual product documentation and code examples included in this toolkit.
Key features of SQL Query Optimization
• **PostgreSQL 12+** *or* **MySQL 8.0 / MariaDB 10.5+**, and its standard CLI • A scratch database you can create and drop. The examples build and seed • Comfort reading SQL. This is intermediate material: it assumes you know • **Window functions (`sql/05`) require MySQL 8.0+ / MariaDB 10.2+** — not MySQL • **`sql/01` + `READING-EXECUTION-PLANS.md`** — how to read a plan in both engines, • **`sql/02` + `INDEX-DESIGN.md`** — selectivity (will an index even help?), the
**PostgreSQL 12+** *or* **MySQL 8.0 / MariaDB 10.5+**, and its standard CLI
A scratch database you can create and drop. The examples build and seed
Comfort reading SQL. This is intermediate material: it assumes you know
**Window functions (`sql/05`) require MySQL 8.0+ / MariaDB 10.2+** — not MySQL
**`sql/01` + `READING-EXECUTION-PLANS.md`** — how to read a plan in both engines,
**`sql/02` + `INDEX-DESIGN.md`** — selectivity (will an index even help?), the
Configure SQL Query Optimization parameters to see how the product works.
# --- PostgreSQL --- createdb sqlopt_demo # Open examples/sample_schema.sql, keep the PostgreSQL seed block (Block A), then: psql -d sqlopt_demo -f examples/sample_schema.sql # Read your first plan: a full scan before any index on customer_id. psql -d sqlopt_demo -c "EXPLAIN (ANALYZE, BUFFERS) \