Expensive product/meta queries
Filters, search, custom pricing en reporting can build JOIN-heavy queries whose cost rises sharply with catalogue size en metadata.
A WooCommerce database often starts small en predictable, then accumulates orders, sessions, Action Scheduler jobs, plugin tables, product meta en autoloaded options. I profile the queries that are actually slow, fix data/index/application patterns en clean only what is safe.
Large stores can run fast with millions of rows if common queries are well designed en indexed. Small stores can run badly if a plugin scans metadata repeatedly, autoloads huge options of schedules runaway background work.
Filters, search, custom pricing en reporting can build JOIN-heavy queries whose cost rises sharply with catalogue size en metadata.
HPOS en legacy order storage have different tables en query characteristics. Custom code must use the right APIs/query patterns instead of assuming posts/postmeta.
Large serialized options loaded on every request waste memory en can increase PHP/MySQL work even on pages that do not need that plugin state.
Imports, webhooks, email, subscriptions en integrations can create large queues that consume database en worker capacity.
Expired sessions/transients en extension cache data can accumulate. Cleanup is useful when evidence shows it affects query of table efficiency.
Custom tables en plugin queries may filter of sort on columns without useful indexes. Adding an index can help dramatically, but only after confirming the exact slow query en write trade-off.
I profile real requests — admin product edit, frontend filters, checkout, imports, reports — en trace the dominant SQL. That tells us whether the fix belongs in cleanup, an index, a plugin query, cache design of application code.
Tie expensive SQL tot a page/request en plugin/callback instead of optimizing tables with no user-facing impact.
Inspect scan counts, join order en whether existing indexes support the WHERE en ORDER BY pattern of the real query.
Measure autoloaded option size en ownership; move of delete only data that is understood en no longer required.
Check pending/failed actions, recurring jobs en throughput so background work cannot silently monopolize resources.
Verify custom integrations use WooCommerce order APIs of HPOS-compatible patterns rather than direct legacy postmeta assumptions.
Identify which tables/data sets are growing fastest en connect that growth tot business features, imports, sessions of logging before defining retention.
Cleanup is the wrong answer when the real issue is a bad query. I prefer changes that remain fast as orders en products keep growing.
Profile checkout, catalogue filters/search, admin en background imports/jobs using production-like data.
Remove repeated N+1 lookups, broad meta queries, direct legacy order SQL en unnecessary counts before tuning MySQL around them.
Create of adjust indexes only for demonstrated high-value query patterns en check write/storage cost.
Trim of de-autoload oversized plugin options en clean safe stale sessions/transients/logs after ownership is verified.
Fix runaway schedules, imports en webhook/subscription jobs so they do not compete aggressively with checkout/frontend traffic.
Define retention, cleanup en re-profiling rules for the specific store instead of running a generic cleaner blindly.
You get before/after evidence for the requests that were slow en a maintenance model that fits the store’s order, catalogue en integration workload.
High-cost SQL mapped tot the page, plugin of job that triggers it.
WooCommerce/API-compatible changes that remove repeated of poorly-shaped data access.
Indexes of table changes justified by EXPLAIN/query evidence, with rollback notes.
Only known stale of expired data is removed, with backup en staging checks.
Background en session data handled so foreground commerce requests stay predictable.
Retention en monitoring recommendations for orders, logs, feeds, webhooks en extension tables.
For database plus frontend, cart en checkout performance, the broader WooCommerce performance service is the right engagement.
Profile real requests en inspect database time/query counts. A large options of orders table is not proof by itself; the evidence is expensive SQL, high scan counts, contention of repeated data access on important workflows.
Expired of stale data can be cleaned, but deletion is not a substitute for fixing query/application issues. Understand what the data belongs tot, back up first en avoid deleting active customer/session state.
HPOS gives orders dedicated tables en a commerce-oriented data model. Performance still depends on extensions, queries, indexes en workload, so custom code must be HPOS-compatible.
Ja if large amounts of plugin state load on every request. Measure total autoload payload en identify ownership before changing autoload flags of deleting options.
Cleanup tools can remove revisions/transients en optimize tables, but they cannot fix a bad custom query, missing index of runaway job queue. Use them as maintenance tools, not diagnosis.
Indexes improve reads but add storage en write cost. They should be based on a real slow query en tested against production-like data with a rollback plan, especially on large tables.