MySQL settings that change query speed
Buffer pool size, redo capacity, flush settings, sort and join buffers, connection limits: what each one trades off and how to change it safely.
More on MySQL and InnoDB
- InnoDB storage: clustered pages, change buffer, adaptive hash, doublewrite
- InnoDB redo, the binlog and the two-phase commit between them
- InnoDB read views, undo purge and the history list
- InnoDB Gap Locks and Next-Key Locks Explained
- A primary key is known before execution starts
- MySQL EXPLAIN Explained: const, ref, range, index, ALL
- MySQL diagnosis: slow log, optimizer trace, performance schema
Keep learning
Overview
8 (1 if pool under 1 GB) innodb_redo_log_capacity (8.0.30+) innodb_log_file_size (before 8.0.30) 48 MB, 2 files fsync (O_DIRECT common) innodb_io_capacity / _max Global / session chapters · mysql and innodb Config settings that change query speed A query can be written well and still run slowly because of how the server is configured: too little memory for cached pages, a redo log that forces constant flushing, or buffers that multiply across hundreds of connections. This chapter covers the dozen MySQL 8.0 settings that matter most, what each one trades away, how to read its current value, and whether you can change it live. The rule throughout: look at the plan first, change one setting at a time, and measure.
How long to wait for a row lock
Default 50 seconds. Lowering it makes blocked statements fail sooner, which protects the pool of connections but moves the problem to your retry logic. See MySQL locks.
Locking breadth
REPEATABLE-READ is the default. READ COMMITTED takes fewer gap locks and can reduce deadlocks on busy tables, at the price of a newer snapshot per statement and a requirement for row-based binlogs.
Plan features
A comma list of switches such as index_merge and hash_join. Leave it alone unless a trace shows a specific feature picking a bad plan, and prefer a per-query hint over a global flip. See the optimizer chapter.
Settings reference (8.0 typical defaults)
Typical default Restart needed SET GLOBAL (dynamic) ✓ Recap Size the buffer pool for the working set, keep per-connection buffers small and budget them times the connection count, leave the flush settings at 1 unless the business accepts losing recent commits, and match the I/O capacity to the device. Change one variable at a time, record the before and after on the same workload, and revert if nothing improved. A setting is the last resort after the plan and the indexes.
More courses
- Jobs, linked to lessons — Browse jobs where every requirement links to the chapter that teaches it. See how ready you are, how long the gap takes to close, and which listings look stale.
- Match a job post to courses — Paste a job post. Each skill is matched to a track here and put in learning order, foundations first.
- React patterns from open source — Patterns extracted from Material UI, Radix, React Aria, React Hook Form, Redux Toolkit, TanStack, and Next.js — not slides about hooks.
- System Design — Core concepts first (SQL vs NoSQL, CAP, indexing, replication, sharding), then designs grouped by what carries them: the database, Redis, Kafka, or many services.
- NestJS: build a real API — One ticket-booking API, built in order: a plain Node server first, then NestJS modules, validation, a real database, and the features real clients lean on.
- Microservices — Microservice patterns one diagram at a time: how to split a monolith, how services talk, and how data stays consistent without distributed transactions.
- Kafka — A beginner-to-senior path through event logs, reliable delivery, production operations, and disaster recovery.
- AI engineering for software engineers — Eight free reads, in order, for software engineers moving into AI: when to build an agent, how to build one, how to test it, and how the model works underneath.
- Frontend system design — How a UI is sliced when it is a product, not a page: ownership of state, cache, routes, and what happens when the network lies.
- TypeScript in depth — The type system as a design tool. Inference, narrowing, generics, and the errors that mean the model is wrong — not a catalog of utility types.
- CSS in depth — See the box, then the page. Visual chapters from the box model through Flexbox surprises, Grid, selectors, and units, then backgrounds, shapes, and visual effects, each with a playground.
- Accessibility — Foundations first (WCAG in plain words, semantic HTML, lists, alt text), then hands-on HTML labs, a full pass of WAI-ARIA 1.3, and a final fix-the-page challenge.
- Docker — What an image is, why layers cache, and how containers find each other on a network.
- Redis — Fifteen Redis patterns, one picture each: cache, session, lock, counter, rate limiter, queue, and when Redis is the wrong tool.
- Kubernetes — Kubernetes from zero to operators: why it exists, Pods, Deployments and Services, then configuration, networking, storage, scheduling, scaling and security.
- AWS — AWS networking in plain English. A VPC is a gated housing society: streets are subnets, the Internet Gateway is the main gate, and a route table is the signboard.
- Networking: the NetRoute game — NetRoute is a packet logistics game. You wire up computers, switches, routers, firewalls and gateways, set each device, and watch glowing packets travel. If a packet gets dropped, the game shows you which header field was wrong.