JusDB
Free DB Audit
Database Performance

MySQL Performance Tuning (2026): Fix Buffer Pool, Kill Unused Indexes, Stop Slow Queries

A 10-step order for MySQL performance tuning: buffer pool sizing, index cleanup, EXPLAIN ANALYZE, query rewrites, slow query log, I/O, redo and connection settings, and MySQL 8.4 defaults.

JusDB Team
Published November 12, 2024
Updated November 26, 2026
11 min read

A pattern we see again and again in MySQL audits: a lookup that should return in milliseconds takes seconds at P99. The table has a dozen indexes, and the query uses none of them. The fix is rarely new hardware or a schema rewrite. It is usually configuration corrections and one missing composite index.

MySQL performance problems almost always have the same root causes: buffer pool misconfiguration, indexing mistakes, and queries the optimizer can't plan well. This guide covers the techniques we use in production — not the stuff from the official docs you've already read.

Short answer: how do you tune MySQL performance? Work in this order. Measure first (slow query log or Performance Schema digests), size innodb_buffer_pool_size so your working set fits in memory, find the few queries that consume most of the total time, read their plans with EXPLAIN ANALYZE, add the right composite indexes and remove unused ones, refresh optimizer statistics, then tune I/O, redo log and connection settings. Re-measure after each change. Hardware is the last lever, not the first. The ten steps below follow that order, and every step links to the section with the SQL.

TL;DR — Highest impact wins
  • Set innodb_buffer_pool_size to 70–80% of RAM on a dedicated server — this one variable matters more than everything else combined
  • Run SELECT * FROM sys.schema_unused_indexes — you almost certainly have indexes costing you write performance
  • Use MySQL Shell's parallel dump and load (util.dumpInstance / util.loadDump) instead of mysqldump for large datasets
  • Try tcmalloc on high-concurrency servers — it can reduce memory fragmentation, takes about 5 minutes, and is easy to measure before and after
  • Use EXPLAIN ANALYZE (MySQL 8.0.18+), not just EXPLAIN — it shows actual rows and timings vs estimates
  • On MySQL 8.4 LTS, check the new InnoDB defaults before copying old 8.0 settings into my.cnf

How to Improve MySQL Performance: 10 Steps in Order

If you want to increase MySQL performance without guessing, follow the steps in this order. Each one either removes a bottleneck or tells you where the next one is.

  1. Baseline the workload. Turn on the slow query log or read Performance Schema digests, and record P95/P99 latency, QPS and the top 10 queries by total time before changing anything.
  2. Size the InnoDB buffer pool. Check the buffer pool hit ratio and size innodb_buffer_pool_size so the working set fits in RAM.
  3. Find the queries that cost the most. Sort by total time (executions × average latency), not by the single slowest query.
  4. Read the real plan. Run EXPLAIN ANALYZE and compare estimated rows with actual rows.
  5. Add the right composite indexes. Equality columns first, then range or sort columns (indexing).
  6. Remove unused and redundant indexes. Make them invisible first, then drop them.
  7. Refresh optimizer statistics. ANALYZE TABLE, and histograms for filtered columns that have no index.
  8. Rewrite the queries indexes can't save. Non-sargable predicates, deep OFFSET pagination and SELECT * (query optimization).
  9. Tune storage I/O, redo log and connections. innodb_io_capacity, innodb_redo_log_capacity and connection limits and pooling.
  10. Check the memory allocator and re-measure. Try tcmalloc, then compare against the baseline from step 1 and keep only the changes that helped.

Start Here: InnoDB Buffer Pool

The most common finding in MySQL audits: the buffer pool left at the 128MB default, even on a 64GB server. This is the single biggest performance lever in MySQL — and the most frequently misconfigured.

The buffer pool is InnoDB's in-memory cache. Every page read from disk is cached here. When your working set fits in the buffer pool, queries read from RAM. When it doesn't, every query hits disk. The difference is 100–1,000× in latency.

text
-- Check your current buffer pool hit ratio
SELECT
  FORMAT(100 - (Innodb_buffer_pool_reads * 100.0 / Innodb_buffer_pool_read_requests), 2) AS hit_ratio_pct,
  FORMAT_BYTES(@@innodb_buffer_pool_size) AS configured_size
FROM (
  SELECT
    SUM(IF(variable_name = 'Innodb_buffer_pool_reads', variable_value, 0)) AS Innodb_buffer_pool_reads,
    SUM(IF(variable_name = 'Innodb_buffer_pool_read_requests', variable_value, 0)) AS Innodb_buffer_pool_read_requests
  FROM performance_schema.global_status
  WHERE variable_name IN ('Innodb_buffer_pool_reads', 'Innodb_buffer_pool_read_requests')
) stats;

If your hit ratio is below 95%, your buffer pool is too small. Below 90% is an emergency. Target: 99%+.

text
-- Dedicated MySQL server: set to 70-80% of RAM
-- 64GB server:
SET PERSIST innodb_buffer_pool_size = 48318382080;  -- ~45GB

-- Or use innodb_dedicated_server for automatic tuning (MySQL 8.0+)
-- Add to my.cnf:
[mysqld]
innodb_dedicated_server = 1

One gotcha with innodb_dedicated_server: it only sizes the variables you have not set yourself. If innodb_buffer_pool_size or innodb_redo_log_capacity is also set explicitly in my.cnf, the explicit value wins and MySQL logs a startup warning. Teams set both, then assume the automatic sizing is active when it isn't. Use one approach or the other, and confirm the result with the query below.

text
-- Verify buffer pool configuration is active
SHOW VARIABLES LIKE 'innodb_buffer_pool_size';
SHOW VARIABLES LIKE 'innodb_dedicated_server';

Indexing: More Isn't Better

Hot tables with a dozen indexes, half of them never read, are a common audit finding. Each unused index costs write performance — every INSERT, UPDATE, and DELETE has to maintain every index. On a write-heavy table, unnecessary indexes are a write amplification tax for zero read benefit.

Find unused indexes

text
-- Indexes that haven't been used since the last server restart
SELECT * FROM sys.schema_unused_indexes
WHERE object_schema NOT IN ('performance_schema', 'information_schema', 'mysql', 'sys');

This view only knows about activity since the last restart. Check SHOW GLOBAL STATUS LIKE 'Uptime' first, and make sure the server has been up through a full business cycle (including month-end jobs and reports) before you trust it.

Find duplicate indexes

text
-- Indexes made redundant by another index (wastes space and write overhead)
SELECT * FROM sys.schema_redundant_indexes;

Use invisible indexes before dropping

Never drop an index cold. Make it invisible first, run for a week, confirm nothing broke, then drop.

text
-- Step 1: Make invisible (query optimizer ignores it, index still maintained)
ALTER TABLE orders ALTER INDEX idx_created_at INVISIBLE;

-- Step 2: Monitor for a week. If performance degrades, make it visible again:
ALTER TABLE orders ALTER INDEX idx_created_at VISIBLE;

-- Step 3: When confirmed safe, drop
ALTER TABLE orders DROP INDEX idx_created_at;

Build composite indexes correctly

The column order in a composite index matters. For a query filtering on status and sorting by created_at:

text
-- BAD: wrong column order (can't use index for the sort)
CREATE INDEX idx_orders ON orders (created_at, status);

-- GOOD: equality filter column first, range/sort column second
CREATE INDEX idx_orders ON orders (status, created_at);

-- Verify the index is being used
EXPLAIN SELECT * FROM orders WHERE status = 'pending' ORDER BY created_at DESC LIMIT 20;
-- Look for: key: idx_orders, Extra: (no "Using filesort" — means index handles sort)

Find tables doing full scans

text
-- Tables that are full-scanned most often
-- (the x$ view returns raw numbers, so FORMAT and FORMAT_PICO_TIME work on them)
SELECT
  object_schema,
  object_name,
  FORMAT(rows_full_scanned, 0) AS rows_scanned,
  FORMAT_PICO_TIME(latency) AS total_latency
FROM sys.x$schema_tables_with_full_table_scans
WHERE object_schema NOT IN ('performance_schema', 'information_schema', 'mysql')
ORDER BY rows_full_scanned DESC
LIMIT 20;

EXPLAIN ANALYZE: The Right Way to Debug Queries

EXPLAIN shows the optimizer's plan. EXPLAIN ANALYZE (MySQL 8.0.18+) actually executes the query and shows you what really happened — including actual row counts vs estimated, and actual timings per step. Because it runs the query, use it on a replica or with care for statements that are already slow.

text
-- EXPLAIN shows estimates (can be wildly wrong)
EXPLAIN SELECT * FROM orders o
JOIN customers c ON o.customer_id = c.id
WHERE o.status = 'pending' AND o.created_at > '2025-01-01';

-- EXPLAIN ANALYZE shows reality
EXPLAIN ANALYZE SELECT * FROM orders o
JOIN customers c ON o.customer_id = c.id
WHERE o.status = 'pending' AND o.created_at > '2025-01-01'\G

-- Key things to look for in the EXPLAIN ANALYZE (tree) output:
-- "rows=X ... (actual ... rows=Y loops=N)" -- if Y >> X, optimizer is wrong, statistics need updating
-- "Sort:" step -- the sort is not served by an index (classic EXPLAIN shows this as "Using filesort")
-- "Temporary table" / "Materialize" -- GROUP BY/DISTINCT is creating temp tables, often avoidable
--                                      (classic EXPLAIN: "Using temporary")
-- "Table scan on ... (cost=X rows=Y)" -- full scan, often a missing index

Update table statistics when optimizer is wrong

text
-- Force statistics recollection on a table
ANALYZE TABLE orders;

-- Or for all tables in a schema
SELECT CONCAT('ANALYZE TABLE ', table_schema, '.', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'your_database'
  AND table_type = 'BASE TABLE';

Histograms for filtered columns without an index

When a query filters on a column that has no index (and adding one isn't worth the write cost), a histogram gives the optimizer the value distribution so it can pick a better join order. Histograms are available from MySQL 8.0.

text
-- Build a histogram on a skewed, non-indexed column
ANALYZE TABLE orders UPDATE HISTOGRAM ON status WITH 64 BUCKETS;

-- See which histograms exist
SELECT schema_name, table_name, column_name
FROM information_schema.column_statistics;

-- Remove one you no longer need
ANALYZE TABLE orders DROP HISTOGRAM ON status;

MySQL Query Optimization: Increase Query Speed Without New Hardware

Indexes only help when the query lets MySQL use them. These four rewrites cover most of the slow queries that survive a good indexing pass.

Keep predicates sargable

Wrapping an indexed column in a function hides it from the index. Move the function to the constant side.

text
-- SLOW: the function on created_at prevents an index range scan
SELECT id, total FROM orders WHERE DATE(created_at) = '2026-03-01';

-- FAST: same result, index on created_at is usable
SELECT id, total FROM orders
WHERE created_at >= '2026-03-01' AND created_at < '2026-03-02';

-- Same problem with implicit type conversion:
-- phone is VARCHAR, so compare it to a string, not a number
SELECT id FROM customers WHERE phone = '5550100';   -- uses the index

Use covering indexes for hot read paths

text
-- If the hot query only needs these columns...
SELECT customer_id, status, total FROM orders WHERE customer_id = 42 AND status = 'paid';

-- ...an index that contains all of them avoids reading the table rows at all
CREATE INDEX idx_orders_cust_status_total ON orders (customer_id, status, total);
-- EXPLAIN shows "Using index" in Extra when the index covers the query

Replace deep OFFSET pagination with keyset pagination

text
-- SLOW deep in the list: MySQL reads and throws away 100,000 rows to return 20
SELECT id, created_at FROM orders ORDER BY id LIMIT 20 OFFSET 100000;

-- FAST: pass the last id from the previous page (here 100000) and seek past it
SELECT id, created_at FROM orders WHERE id > 100000 ORDER BY id LIMIT 20;

Batch writes instead of row-by-row commits

text
-- SLOW: one transaction (and one redo log flush) per row
INSERT INTO events (user_id, kind) VALUES (1, 'login');
INSERT INTO events (user_id, kind) VALUES (2, 'login');

-- FAST: multi-row insert inside one transaction (keep batches to a few thousand rows)
START TRANSACTION;
INSERT INTO events (user_id, kind) VALUES (1, 'login'), (2, 'login'), (3, 'logout');
COMMIT;

Slow Query Log: Your Continuous Performance Monitor

text
-- Enable slow query log (safe to do on production)
SET GLOBAL slow_query_log = 1;
SET GLOBAL long_query_time = 1;        -- log queries over 1 second
SET GLOBAL log_queries_not_using_indexes = 1;  -- log full scans too
SET GLOBAL slow_query_log_file = '/var/log/mysql/slow.log';

-- Analyze the slow log with mysqldumpslow
mysqldumpslow -s t -t 20 /var/log/mysql/slow.log  -- top 20 by total time
mysqldumpslow -s c -t 20 /var/log/mysql/slow.log  -- top 20 by count

-- Or use Performance Schema directly (no log file needed)
-- Timer columns are in picoseconds: divide by 1e12 for seconds
SELECT
  SUBSTRING(digest_text, 1, 120) AS query,
  count_star AS executions,
  ROUND(avg_timer_wait / 1e12, 3) AS avg_sec,
  ROUND(sum_timer_wait / 1e12, 2) AS total_sec,
  ROUND(sum_rows_examined / count_star) AS avg_rows_examined
FROM performance_schema.events_statements_summary_by_digest
WHERE schema_name = 'your_database'
ORDER BY sum_timer_wait DESC
LIMIT 15;

For larger slow logs, Percona Toolkit's pt-query-digest groups queries by fingerprint and reports response-time share, which makes step 3 (find the queries that cost the most) much faster than reading mysqldumpslow output.


MySQL Shell: Faster Parallel Data Import

If you're still using mysqldump for large datasets, you're leaving significant time on the table. MySQL Shell's parallel dump and load utility is not well-known outside the DBA community, but we use it on every large migration now.

text
# Traditional approach — single-threaded, slow
mysqldump mydb > backup.sql                    # hours for large DBs
mysql mydb < backup.sql                        # equally slow

# MySQL Shell — parallel, chunk-based, fast
mysqlsh

# Dump using all CPU cores
JS> util.dumpInstance("/opt/dump/", {threads: 16})

# Load using all CPU cores
JS> util.loadDump("/opt/dump/", {threads: 16})

Why it is faster: mysqldump writes one SQL stream and the restore replays it on a single thread. MySQL Shell splits large tables into chunks, dumps and loads them on many threads at once, and can defer secondary index creation until after the data is in. The gain depends on table sizes, CPU count and storage, so time a test run before you plan a maintenance window around it.

For initial bulk loads where you can trade durability for speed

text
-- Disable redo logging (ONLY during initial data load, re-enable immediately after)
ALTER INSTANCE DISABLE INNODB REDO_LOG;

-- Optimize for bulk insert
SET GLOBAL innodb_extend_and_initialize = OFF;
SET GLOBAL innodb_max_dirty_pages_pct = 10;
SET GLOBAL innodb_max_dirty_pages_pct_lwm = 10;

-- Run your load...

-- Re-enable redo log immediately
ALTER INSTANCE ENABLE INNODB REDO_LOG;

Warning: disabling redo logging means a crash during the load leaves the database in an unrecoverable state. Only do this if you have the source data and can re-run the load. Never do this on a running production server.


tcmalloc: The 5-Minute Win Most Teams Skip

MySQL uses the system's default memory allocator (glibc malloc on Linux). Under high concurrency, glibc malloc can fragment badly — MySQL ends up holding much more resident memory than it actually needs, and CPU time goes into memory management.

Switching to tcmalloc takes about 5 minutes. On servers with many concurrent connections it often lowers resident memory and steadies throughput; how much depends on the workload, so record memory use and P99 latency before and after the change.

text
# Install tcmalloc (RHEL/CentOS)
sudo yum install gperftools-libs

# Install on Ubuntu/Debian
sudo apt-get install libtcmalloc-minimal4

# Configure MySQL to use tcmalloc via systemd override
sudo systemctl edit mysqld
# Add:
[Service]
Environment="LD_PRELOAD=/usr/lib64/libtcmalloc_minimal.so.4"

sudo systemctl daemon-reload
sudo systemctl restart mysqld

# Verify it's loaded
sudo cat /proc/$(pidof mysqld)/maps | grep tcmalloc

On Ubuntu and Debian the service is usually named mysql rather than mysqld, and the library lives at /usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4. Use ldconfig -p | grep tcmalloc to find the exact path before setting LD_PRELOAD.

We check the memory allocator on every dedicated MySQL server we review. It's one of the highest ROI changes you can make with no application code changes whatsoever.


Storage I/O Configuration

innodb_io_capacity tells InnoDB how fast your storage is, so it can tune its background flush rate. Getting this wrong in either direction causes problems: too low and dirty pages accumulate; too high and you thrash the disk unnecessarily.

text
-- SSD (SATA or standard NVMe)
SET GLOBAL innodb_io_capacity = 2000;
SET GLOBAL innodb_io_capacity_max = 4000;

-- High-end NVMe (AWS io2, gp3 at max IOPS)
SET GLOBAL innodb_io_capacity = 4000;
SET GLOBAL innodb_io_capacity_max = 8000;

-- Traditional spinning disk (HDD)
SET GLOBAL innodb_io_capacity = 200;
SET GLOBAL innodb_io_capacity_max = 400;

-- Check current dirty page ratio (should be < 75% for healthy operation)
SELECT
  variable_name,
  variable_value
FROM performance_schema.global_status
WHERE variable_name IN (
  'Innodb_buffer_pool_pages_dirty',
  'Innodb_buffer_pool_pages_data'
);

These values are starting points for MySQL 8.0, where the default is 200. MySQL 8.4 raised the default innodb_io_capacity to 10000, so on 8.4 check the current value with SHOW VARIABLES and lower it only if you see flushing spikes on slower storage.

Redo log sizing

Undersized redo logs cause excessive checkpoint flushing, which hurts write throughput. In MySQL 8.0.30+, use innodb_redo_log_capacity to configure it dynamically:

text
-- Measure redo log generation rate (run for 60 seconds)
SELECT VARIABLE_VALUE INTO @start FROM performance_schema.global_status
WHERE VARIABLE_NAME = 'Innodb_redo_log_current_lsn';

SELECT SLEEP(60);

SELECT
  FORMAT_BYTES(ABS(VARIABLE_VALUE - @start)) AS redo_per_minute,
  FORMAT_BYTES(ABS(VARIABLE_VALUE - @start) * 60) AS redo_per_hour
FROM performance_schema.global_status
WHERE VARIABLE_NAME = 'Innodb_redo_log_current_lsn';

-- Set capacity to 2x the per-hour generation rate
SET PERSIST innodb_redo_log_capacity = 2147483648;  -- 2GB example

Connection Management

Each MySQL connection consumes memory — roughly 1–4MB depending on your buffer sizes and query complexity. At 500 connections, that's 500MB–2GB just for connection overhead before a single query runs.

text
-- Check current connection usage
SHOW STATUS LIKE 'Threads_connected';
SHOW STATUS LIKE 'Threads_running';     -- actively executing right now
SHOW STATUS LIKE 'Max_used_connections'; -- peak since last restart

-- If Threads_running >> CPU cores, you have a concurrency problem
-- If Max_used_connections approaches max_connections, you risk connection exhaustion

-- Use ProxySQL or MySQL Router for connection pooling
-- Or configure connection memory limits (MySQL 8.0.28+):
SET GLOBAL connection_memory_limit = 2097152;       -- 2MB example (the minimum); set it above your real per-connection peak
SET GLOBAL global_connection_memory_limit = 536870912;  -- 512MB total
SET GLOBAL global_connection_memory_tracking = 1;

-- Monitor per-connection memory
SELECT FORMAT_BYTES(variable_value) AS total_connection_memory
FROM performance_schema.global_status
WHERE variable_name = 'Global_connection_memory';

Note that the connection memory limits do not apply to the root account or other administrative accounts, so test them with your real application user. A statement that crosses the limit fails with an error, so start with a generous value and lower it only after you have measured real per-connection usage.


MySQL 8.4 LTS: What Changes for Performance Tuning

MySQL 8.0 reached end of life in April 2026. If you're still on 8.0 and planning the move to 8.4 LTS, here's what changes for performance:

  • Automatic histogram updates: 8.4 can update column histograms automatically (UPDATE HISTOGRAM ... AUTO UPDATE), reducing optimizer errors caused by stale statistics
  • InnoDB parallel DDL: Index creation uses parallel threads by default (innodb_ddl_threads, available since 8.0.27) — large table ALTER operations are significantly faster
  • New InnoDB defaults: innodb_io_capacity defaults to 10000, innodb_adaptive_hash_index is OFF, innodb_change_buffering is none, and innodb_flush_method defaults to O_DIRECT on Linux. A my.cnf copied from 8.0 can silently override these, so review it line by line
  • Removed deprecated variables: Several variables from 8.0 are gone in 8.4 — run MySQL Shell's upgrade checker (util.checkForServerUpgrade()) and review its warnings before upgrading
  • Default authentication: caching_sha2_password is the default, and the legacy mysql_native_password plugin is disabled by default in 8.4 (and removed in 9.0) — old clients and drivers may break
text
-- Check for deprecated variables before upgrading
SELECT * FROM performance_schema.global_variables
WHERE variable_name IN (
  'query_cache_size',
  'query_cache_type',
  'innodb_log_file_size',  -- replaced by innodb_redo_log_capacity
  'innodb_log_files_in_group'
);

-- query_cache_* were removed in 8.0, so they should not appear at all.
-- innodb_log_file_size and innodb_log_files_in_group are deprecated (8.0.30+):
-- remove them from my.cnf and set innodb_redo_log_capacity instead.

For a full upgrade guide, see our MySQL 8.0 EOL and 8.4 upgrade guide.


Production Monitoring Dashboard

text
-- One-shot performance snapshot
SELECT
  'Buffer Pool Hit %'                          AS metric,
  CONCAT(FORMAT(100 - (r.v * 100.0 / rr.v), 2), '%') AS value
FROM
  (SELECT variable_value AS v FROM performance_schema.global_status WHERE variable_name = 'Innodb_buffer_pool_reads') r,
  (SELECT variable_value AS v FROM performance_schema.global_status WHERE variable_name = 'Innodb_buffer_pool_read_requests') rr

UNION ALL SELECT 'QPS', FORMAT(q.v / u.v, 0)
FROM
  (SELECT variable_value AS v FROM performance_schema.global_status WHERE variable_name = 'Questions') q,
  (SELECT variable_value AS v FROM performance_schema.global_status WHERE variable_name = 'Uptime') u

UNION ALL SELECT 'Active Connections', variable_value
FROM performance_schema.global_status WHERE variable_name = 'Threads_connected'

UNION ALL SELECT 'Running Threads', variable_value
FROM performance_schema.global_status WHERE variable_name = 'Threads_running'

UNION ALL SELECT 'Slow Queries (total)', variable_value
FROM performance_schema.global_status WHERE variable_name = 'Slow_queries';

Automated alerting thresholds

text
SELECT
  CASE
    WHEN hit_ratio < 95 THEN CONCAT('CRITICAL: Buffer pool hit ratio ', FORMAT(hit_ratio, 1), '%')
    WHEN hit_ratio < 98 THEN CONCAT('WARNING: Buffer pool hit ratio ', FORMAT(hit_ratio, 1), '%')
    ELSE CONCAT('OK: Buffer pool ', FORMAT(hit_ratio, 1), '%')
  END AS buffer_pool_alert
FROM (
  SELECT 100 - (r.v * 100.0 / rr.v) AS hit_ratio
  FROM
    (SELECT variable_value AS v FROM performance_schema.global_status WHERE variable_name = 'Innodb_buffer_pool_reads') r,
    (SELECT variable_value AS v FROM performance_schema.global_status WHERE variable_name = 'Innodb_buffer_pool_read_requests') rr
) m;

For continuous MySQL database performance monitoring rather than one-off snapshots, export these counters to your existing monitoring stack (Percona Monitoring and Management, Prometheus with mysqld_exporter, or your cloud provider's metrics) and alert on trends, not single readings.


Counterintuitive Tips We've Learned in Production

  • Sort columns in EXPLAIN output don't always mean what you think: "Using index" means the query was satisfied entirely from the index (fast). "Using index condition" means ICP (Index Condition Pushdown) applied — still good. "Using filesort" doesn't always mean slow — filesort of 100 rows is faster than a bad index scan of 10M rows.
  • AUTO_INCREMENT gaps are fine: Teams sometimes implement complex "fill gaps" logic to avoid gaps in sequential IDs. This introduces locking and complexity for no real benefit. Gaps in AUTO_INCREMENT are normal and harmless.
  • VARCHAR(255) vs VARCHAR(100) doesn't matter for performance on disk — InnoDB stores only the actual length. But it can matter in memory: some in-memory temp table and sort paths size buffers from the declared length. Oversized VARCHAR columns can cause memory bloat in query processing.
  • SELECT * in production is always wrong: Even if you need all columns, specifying them explicitly allows the optimizer to consider covering indexes and avoids fetching columns you're adding to the table later.

Working with JusDB

MySQL performance problems almost always fall into one of five categories: buffer pool misconfiguration, index sprawl, optimizer statistics staleness, connection pool saturation, or slow queries without proper analysis. We see all of them on MySQL running in AWS RDS, self-hosted on EC2, and on bare metal.

Our MySQL consulting work starts with a review of your slow query log, Performance Schema and InnoDB metrics, and ends with a prioritized list of what to fix and in what order. For a scoped tuning engagement, see MySQL performance tuning. Results depend on the workload; we baseline before and measure after each approved change.

If you're dealing with specific issues — P99 latency spikes, buffer pool thrashing, connection exhaustion, or an upcoming 8.4 upgrade — reach out and we'll take a look. Or request a free audit of one database instance, subject to availability: mutual NDA before read-only access, a prioritized report within one week after access is ready, and no obligation.

Related reading: MySQL Indexes: Complete Guide | MySQL 8.0 EOL Guide | MySQL Architecture Deep Dive

Share this article

Database engineering notes

Articles like this one, in your inbox. No spam, unsubscribe anytime.

JusDB Team

Official JusDB content team

Deeper Reading

Curated companion guides for readers who want to go deeper on this topic.