Fill the Server: 80% off your first 4 monthly invoices, monthly billing. Ends Nov 30, 2026. 25 spots in this batch.FILL25
Fill the Server, annual: about 29.63% off your first annual invoice. Ends Nov 30, 2026.FILL25Y
Fill the Server, 2 year term: about 15.69% off your first biennial invoice. Ends Nov 30, 2026.FILL25B
Fill the Server, 3 year term: about 11.11% off your first triennial invoice. Ends Nov 30, 2026.FILL25T
80% off your first 3 months, monthly billing. Ends Dec 25, 2027.3MONTHS80
50% off your first annual Shared term. Ends Dec 31, 2027.50SHARED
Shared Starter, 3 year term: C$105.84 total.MOOSE294
20% off your first 3 monthly VPS invoices. Ends Dec 31, 2027.20VPS3
25% off your first annual base VPS term.25VPS

← All guides

WordPress

MySQL slow queries: capture the statement before adding an index

Published August 2026 · 2 min read · Updated 2026-09-05

MySQL slow queries become visible as request latency, worker queues, CPU use, disk activity, or lock waits. The useful workflow captures the exact expensive query and execution plan before adding indexes or increasing database resources.

Capture slow statements during the real workload

Use the slow query log, performance_schema, application profiling, or managed database tooling to identify query text, execution count, duration, rows examined, and timing. A query that takes 400 ms once may matter less than a 40 ms query executed thousands of times.

Protect sensitive query parameters when sharing logs.

Read the execution plan

EXPLAIN can show table scans, index selection, joins, sorting, temporary tables, and estimated rows. Compare the predicates/order/grouping with existing indexes before creating another one.

An index speeds some reads but consumes storage and write/maintenance cost. Avoid overlapping indexes added without evidence.

Check locks and application query patterns

A query can be “slow” because it is waiting for another transaction even when its own execution plan is inexpensive. Inspect lock waits, transaction duration, connection usage, and batch operations.

WordPress plugins can generate N+1 patterns or repeated metadata queries that are better fixed at application level.

Retest representative traffic

After query/index/application changes, compare p95/p99 request latency, database CPU, rows examined, buffer/cache behavior, and write cost. Resize database resources only after the remaining constraint is measured.

  • Capture exact slow queries.
  • Inspect EXPLAIN.
  • Check locks and repetition.
  • Retest end-to-end latency.

Next step

Use slow-query evidence, execution plans, lock waits and request frequency to fix expensive MySQL work without guessing at indexes or server size.

Explore DotMoose WordPress hosting

Keep reading

Related guides.

Do I need web hosting for WordPress? What WordPress actually needs

Self-hosted WordPress needs web hosting, but it does not require a specially branded WordPress plan. Compare WordPress.com, regular shared hosting, WordPress hosting and VPS options.

Read the guide

How to move web hosting without downtime

Move a website and database with destination testing, final synchronization, controlled DNS cutover, and rollback while preserving separate mail routing.

Read the guide

PHP timeout troubleshooting: PHP, PHP-FPM or the web server?

Find which PHP timeout fired, check the right configuration, and distinguish PHP execution limits, PHP-FPM termination and nginx FastCGI read timeouts.

Read the guide

More wordpress guides

We will handle the move. You check it first.

Your current site stays online until your new one is ready. You approve the copy first, and if anything is not right we switch you back right away. The price you pick is the price you renew at.

Start my free moveSee plans and prices
See pricesFree move