wp_slow_queries
Severity: Warning
Signal: perf.slow_queries — slow query detection triggered
What this signal means
One or more database queries during a request exceeded the slow query threshold (500ms by default). Slow queries directly increase page load time for visitors.
What surprise this prevents
Database performance degradation accumulating gradually — queries that were fast on a small dataset becoming bottlenecks as the site grows, with no visible error until pages become unacceptably slow.
Why it matters
Slow database queries are one of the most common causes of poor WordPress performance. A single unoptimized query can add seconds to every page load. If the query runs on every request (e.g. in wp_options), the performance impact is site-wide.
Investigate
View entity alerts in Logystera →
Check:
payload.slow_count— how many slow queries on this request?payload.threshold_ms— what threshold triggered this?- Correlate with
http.requestfor the samerequest_idto see which URL was slow.
Recommended actions
-
Enable MySQL slow query log to capture the actual queries (requires server access):
ini # my.cnf slow_query_log = 1 slow_query_log_file = /var/log/mysql/slow.log long_query_time = 0.5 -
Use Query Monitor plugin in WordPress admin — it shows all queries per page, their duration, and the calling code. Install temporarily, check the slow page, then remove.
-
Check for missing indexes. Common slow queries in WordPress involve
wp_postmetaandwp_options. Check for:sql EXPLAIN SELECT * FROM wp_postmeta WHERE meta_key = '_thumbnail_id'; -
Check
wp_optionsautoloaded data. Large amounts of autoloaded data (>1MB) slow every single WordPress request:sql SELECT SUM(LENGTH(option_value)) / 1024 / 1024 AS size_mb FROM wp_options WHERE autoload = 'yes';Use a plugin like WP Options Manager to clean up stale options. -
Add object caching. Install Redis or Memcached as a WordPress object cache to reduce repetitive database queries.
-
Check your hosting. Shared hosting MySQL often runs on overloaded servers. A VPS or managed WordPress host (Kinsta, WP Engine) will have better database performance.
When to safely ignore
Slow queries during one-time admin operations (bulk import, full-site search indexing, large export) are expected. These operations are designed to be thorough, not fast.
If payload.slow_count is 1 and the affected query is on a low-traffic path, assess recurrence before treating it as a priority fix.
Signal reference
{
"event_type": "perf.slow_queries",
"payload": {
"slow_count": 3,
"threshold_ms": 500
}
}