SQLAlchemy 2.0 Textbook Ch. 9 — Performance: N+1, Bulk Ops, Streaming
Practical SQLAlchemy performance: avoiding N+1, bulk_insert_mappings, server-side cursors, EXPLAIN ANALYZE patterns.
Practical SQLAlchemy performance: avoiding N+1, bulk_insert_mappings, server-side cursors, EXPLAIN ANALYZE patterns.
Cheatsheet: Path basics, joining, globbing, reading, writing, traversing.
Cheatsheet: structlog with trace IDs, OTEL auto-instrumentation, Prometheus, slow-query log.
Cheatsheet: copy-paste migrations for common changes — add NOT NULL column, rename, FK, ENUM, JSONB, view, trigger.
Cheatsheet: model_json_schema modes, json_schema_extra, custom JSON Schema, LLM tools.
Cheatsheet: PgBouncer, read replica routing, OTEL instrumentation, multi-tenancy (RLS), DR / failover.
Pydantic v2 perf tips, hot path optimization, FastAPI patterns, and when to consider msgspec / attrs.
Schema migrations: Alembic integration, autogenerate, manual edits, branching, online schema changes, deploy patterns.
Cheatsheet: datetime, zoneinfo, ISO 8601, timezone conversion, common pitfalls.
Cheatsheet: speed pitfalls and fixes; when to reach for msgspec.