Skip to main content

Database Optimisation

When every page waits on the database, everything feels slow

We analyse what your database is actually doing, fix the queries and tables that hold up page generation, and tune configuration so it copes with the traffic and data you have today.

Queries optimisedBackup verified

Business impact

The hidden bottleneck behind slow admin screens and checkouts

Databases slow down gradually as orders, logs, revisions and plugin data pile up. The symptoms appear as slow back-office screens, timeouts during busy periods and rising hosting costs.

Slow server response on every request

Pages that cannot be cached, such as carts, accounts, search results and admin screens, depend entirely on how fast the database answers.

Instability under load

A handful of inefficient queries can lock tables or exhaust connections during a sale or campaign, causing errors for every visitor.

Paying for hardware instead of fixing causes

Upgrading the server can mask a missing index for a while, but the underlying inefficiency grows with your data.

Common issues

Problems we regularly solve

Missing or unused indexes

Queries scan entire tables because the columns they filter or join on are not indexed, while other indexes exist that nothing uses.

Bloated autoloaded options in WordPress

Plugins store large settings and transient data in wp_options with autoload enabled, so it is loaded on every single page request.

Table bloat and orphaned data

Post revisions, expired transients, old sessions, logs and data left behind by removed plugins inflate tables and backups.

Inefficient queries from plugins or custom code

Unbounded meta queries, queries inside loops and searches on unindexed text columns that run acceptably on small data sets but not at scale.

Default database configuration

An InnoDB buffer pool far smaller than the working data set forces constant disk reads, regardless of how fast the server is.

Mixed or outdated storage engines

Legacy MyISAM tables with table-level locking sitting alongside InnoDB, causing contention when writes and reads overlap.

What's covered

What's included in database optimisation

Database optimisation is a focused piece of performance work. For routine upkeep such as backups, integrity checks and upgrades, see database maintenance.

Slow query analysis

Enabling and reviewing the slow query log, using EXPLAIN to understand execution plans and identifying the queries that consume the most total time.

Index design

Adding composite indexes that match real query patterns and removing redundant ones that slow down writes.

WordPress and WooCommerce clean-up

Reviewing autoloaded options, expired transients, revisions and orphaned post meta, and moving large stores towards high-performance order storage where appropriate.

Table maintenance

Identifying fragmented and oversized tables, archiving or purging data according to your retention needs and converting legacy MyISAM tables to InnoDB.

Configuration tuning

Sizing the InnoDB buffer pool, connection limits, temporary table settings and log file sizes to suit available memory and workload.

Application-level caching

Where your hosting supports it, configuring a persistent object cache such as Redis so repeated lookups do not hit the database at all.

Maintenance activities

What we do, and how often

Exact frequencies depend on your plan and platform. This is a typical schedule.

On onboarding

  • Verified backup of the database before any change
  • Slow query log capture over a representative period
  • Table size, engine and index inventory
  • Review of current MySQL or MariaDB configuration

On demand

  • Index changes tested on a staging copy of the data
  • Clean-up of transients, revisions and orphaned records
  • Rewriting or replacing specific slow queries in custom code

Quarterly

  • Re-review of the slow query log
  • Autoloaded options size check
  • Growth trend for the largest tables

Our methodology

How we work

01

Back up and capture

We take a verified backup, then collect slow query and performance schema data over normal and busy periods.

02

Rank by total cost

Queries are ranked by total time consumed, not just individual duration, because a fast query run thousands of times can matter more than one slow report.

03

Test on a copy

Index and schema changes are tested on a staging copy with production-like data, comparing execution plans before and after.

04

Apply in a planned window

Changes to large tables are scheduled for low-traffic periods, using online schema change methods where the table size requires it.

05

Measure and document

We compare query times and server response before and after, and record every change for future reference.

Business benefits

What you gain

Faster uncached pages

Carts, account areas, search and admin screens benefit directly when the database answers more quickly.

More headroom for busy periods

Efficient queries use fewer resources, leaving more capacity for traffic peaks before errors appear.

Smaller, quicker backups

Removing orphaned and expired data reduces database size, which shortens backup and restore times.

Evidence before upgrades

You can decide on hosting upgrades knowing whether the database is genuinely constrained or simply inefficient.

Technologies supported

  • MySQL
  • MariaDB
  • Percona Server
  • InnoDB
  • Slow query log
  • EXPLAIN and EXPLAIN ANALYZE
  • Performance Schema
  • pt-query-digest
  • Query Monitor
  • WP-CLI
  • Redis
  • phpMyAdmin

Running something not listed? Ask us – we'll tell you honestly if it's a fit.

Who it's for

Who needs database optimisation?

Large WooCommerce and Magento stores

Stores with years of orders, customers and product data where admin and checkout have slowed over time.

Membership and learning platforms

Sites with many logged-in users, where pages cannot be fully cached.

Custom web applications

Applications whose queries were written for a small data set and now need indexing and tuning.

Industry guidance: E-commerce · Education · SaaS Companies

FAQs

Database Optimisation: common questions

Is database optimisation safe to run on a live site?
Analysis is low risk. Changes such as new indexes or clean-ups are tested on a copy first, applied after a verified backup and scheduled for quiet periods, which helps reduce the risk of disruption.
Will you delete data from our database?
Only data you agree is safe to remove, such as expired transients, old revisions or logs beyond your retention period. We list what will be removed before we do anything, and a backup is taken first.
What are autoloaded options and why do they matter?
In WordPress, options marked for autoload are read on every page request. When plugins store large amounts of data this way, every page pays the cost, even pages that never use it.
Do you work on databases other than MySQL?
Our core focus is MySQL and MariaDB, which power most PHP-based websites and stores. For other engines, we will tell you during the audit whether we can help or whether a specialist is better suited.
Would a bigger server fix the problem instead?
Sometimes more memory genuinely helps, for example when the buffer pool cannot hold the working data. Often, though, a missing index or a runaway plugin is the real cause, and fixing it is more durable than upgrading.

Find the queries holding your site back

Request a technical audit and we will analyse your slow query log and table health before recommending changes.