1.

Start with the request that is hurting the business

A database can contain millions of rows and still answer the important requests quickly. A smaller database can struggle because one search joins several metadata tables or a plugin repeats the same lookup hundreds of times. Database size is therefore an investigation clue, not a diagnosis. Begin with a specific business symptom: slow product filters, delayed publishing, an unresponsive account page, or a checkout that becomes unreliable during campaigns. Record the route, user state, response time, error rate, traffic level and recent changes. Compare anonymous and authenticated requests separately because a fast cached homepage says little about a customer placing an order. Establish a representative baseline over ordinary activity and peak periods. The aim is to understand which operations spend time in the database and what that delay means for visitors, editors and revenue.

2.

Map the workload before changing the tables

Create an inventory of the database engine and version, table sizes, indexes, scheduled tasks and plugins that own custom tables. WordPress prefixes are configurable, so never assume every installation uses the same table names. Track reads and writes separately: an archive page and an import job place different demands on the server. Collect query timings from controlled profiling and database observability, then group equivalent queries into patterns. A query taking a modest amount of time can dominate the workload when executed thousands of times. Capture the caller or stack where possible so the finding leads to a code change rather than an unexplained server adjustment. Protect the collected evidence because statements may include personal data. Restrict access, redact values and agree a retention period. Avoid leaving detailed development logging enabled indefinitely on a busy production site.

3.

Treat autoloaded options as shared startup overhead

WordPress uses its options system for settings and operational data. The wp_load_alloptions implementation loads the options whose autoload values qualify for the installed version and caches the resulting collection. Investigate the combined payload and the largest contributors instead of counting rows alone. A plugin might keep a large historical response or diagnostic record in an option that is consulted only in its administration screen. That is a useful candidate for review, but its purpose must be confirmed before changing anything. Use current WordPress APIs and the plugin’s supported configuration where available, since autoload representation has evolved. Test both the first request and subsequent requests with persistent object caching. Reducing unnecessary startup data can help memory use and processing, but disabling autoload for settings used on every request can simply create extra lookups and move the cost elsewhere.

4.

Understand why postmeta becomes expensive

The metadata model lets plugins attach flexible values to posts, products and other content. That flexibility does not make every combination of filters and sorting equally efficient. Multiple meta_query clauses, comparisons on stored strings and ordering by converted numeric values can require substantial work as the catalogue grows. Inspect the actual generated SQL and the shape of the data, including missing keys, duplicate values and uneven distributions. For example, a hypothetical store filtering a large catalogue by several plugin attributes might benefit more from changing its data model than from deleting old revisions. First evaluate established taxonomy or product lookup mechanisms. A custom table can make sense for a stable, heavily queried domain, but it brings migration, synchronization and maintenance responsibilities. Choose it when the measured workload justifies that responsibility, rather than treating it as a default optimization.

5.

Use slow query evidence and EXPLAIN together

A slow query log helps identify costly statements under a chosen threshold and observation window. Its value depends on appropriate configuration, sufficient coverage and an awareness of logging overhead. Pair aggregated observations with EXPLAIN on representative statements and realistic parameters. Look at access paths, estimated rows, joins and filtering to understand why the server performs the work. An index appearing in the plan is not proof that the query is efficient; it may still examine many rows. Conversely, a table scan can be sensible for a small table or a query returning much of its contents. Where the installed engine supports execution analysis, remember that running the statement actually consumes resources. Use staging or carefully bounded production diagnostics. MySQL and MariaDB differ in details, so interpret the plan against the exact engine and version instead of copying conclusions from another installation.

6.

Add indexes for a proven access pattern

An index is a maintained data structure with costs in storage, memory and writes. Select candidate columns from the actual filters, joins and sort requirements, and examine column order and selectivity. Do not add a collection of generic indexes because an online checklist recommends them. Compare the execution plan and elapsed time before and after on a staging copy that preserves useful data distributions. Test inserts and updates as well as reads, especially for orders, imports and synchronization jobs. Adding an index to a large table may involve locking, additional disk space or lengthy background work depending on the engine and operation. Plan that operation with the infrastructure owner, identify the available maintenance window and define an abort condition. Keep a record of why the index exists so later plugin upgrades or schema migrations can be checked against it.

7.

Separate cache strategy from database correction

Persistent object caching can keep reusable WordPress objects available across requests; a full page cache can return a prepared response without running the ordinary PHP rendering path. These solve different problems. Redis configured as an object cache does not automatically provide safe HTML caching, and neither layer repairs a poorly designed write operation. Modern MySQL no longer includes the old query cache, so historic advice about enabling it should not be confused with application caching. Define cache keys, expiration and invalidation around the meaning of the data. Account information and checkout state require particular care: a shared page cache must not serve one customer’s personalized response to another. Measure cache misses, evictions and regeneration costs. Check the database under cold cache conditions as well, because a restart or broad purge can expose work that warm cache previously concealed.

8.

Make cleanup reversible and test restoration

Database housekeeping should begin with ownership and retention requirements. Unused plugin tables, stale transient records and accumulated revisions are potential review areas, but they are not automatically disposable. Determine whether an apparently inactive plugin still supplies reports, redirects or data needed for a future migration. Prefer supported application maintenance tools and specific reviewed changes. Take a consistent backup covering the database and the corresponding files, then restore it into an isolated environment and verify important workflows. A backup job marked successful does not establish that the site can be recovered. Agree who can approve changes, how long recovery may take and which writes would be lost if rollback becomes necessary. Avoid broad deletion recipes and direct edits to serialized data. For a live shop, rolling back an entire database after new orders arrive requires reconciliation rather than a casual replacement.

9.

Deliver an improvement that the team can maintain

At 8web, a database audit can connect request traces, query patterns, plugin ownership and infrastructure metrics into a prioritized engineering plan. The useful deliverable is a list of specific changes with evidence, expected impact, implementation risk and a recovery procedure. Depending on the findings, that work may involve a targeted plugin fix, revised query logic, managed WordPress infrastructure or a carefully tested schema change. Acceptance should include faster representative requests and preserved business behavior, not only a smaller database report. After release, compare the same routes and traffic conditions, watch error rates and confirm publishing, search and order workflows. Record the baseline and the new result without presenting a hypothetical improvement as a measured client outcome. Schedule a follow-up after a meaningful catalogue or traffic change, because an optimization that works today can meet a different workload tomorrow.

FROM READING TO ACTION

A clear plan for your platform.

Tell us where your platform struggles and what needs to improve. Our team can connect the diagnosis with code, performance and infrastructure work.

Discuss your platform

Sources and further reading