WordPress Developer Ukraine, Kyiv
MySQL Binary Log and Point-in-Time Recovery for WordPress

MySQL Binary Log and Point-in-Time Recovery for WordPress

Point-in-time recovery for WordPress with the MySQL binary log A nightly backup protects against losing everything, but not against losing a day. When a faulty plugin update or a wrong DELETE destroys data at 15:42, restoring last night’s dump also throws away every order and comment since midnight. MySQL’s binary log records every change; with…
MySQL InnoDB Buffer Pool Tuning and Monitoring

MySQL InnoDB Buffer Pool Tuning and Monitoring

InnoDB buffer pool for WordPress: size it, then check that it works The InnoDB buffer pool is MySQL’s memory cache for table and index pages. When the working set of a WordPress database (the posts, the meta, the options, the WooCommerce lookup tables that are actually read) fits into it, queries are served from RAM.…
MySQL Connection Pooling with ProxySQL for WordPress

MySQL Connection Pooling with ProxySQL for WordPress

“Too many connections”: PHP-FPM, MySQL and when ProxySQL helps PHP has no connection pool in the usual sense: every request that WordPress handles opens its own MySQL connection and closes it at the end. Under load, the number of connections equals the number of busy PHP-FPM workers, from every web server. When that number exceeds…
MySQL GENERATED Columns: Virtual Indexes and JSON Extraction

MySQL GENERATED Columns: Virtual Indexes and JSON Extraction

MySQL generated columns: index values that are computed or inside JSON A query that filters on LOWER(email), on DATE(created_at) or on a key inside a JSON document cannot use a normal index: the index stores the column, not the result of the expression. A generated column stores (or computes) that expression as a column of…
Query Monitor: Diagnosing Slow Queries and Hooks in WordPress

Query Monitor: Diagnosing Slow Queries and Hooks in WordPress

Query Monitor: find what makes a WordPress page slow A slow page has a cause somewhere between the database, PHP code, hooks and external HTTP requests. Query Monitor is a free debugging plugin that shows all of this for the current request in a panel under the admin bar: every database query with its time…
MySQL Table Partitioning for Large WordPress Databases

MySQL Table Partitioning for Large WordPress Databases

MySQL partitioning for large WordPress log tables Partitioning splits a table into separate physical parts by a rule, for example one part per month, while queries still see one table. For WordPress, the useful case is not wp_posts or wp_postmeta, but the large append-only tables that plugins create: logs, statistics, events. There, partitions make old…
MySQL Triggers for WordPress Database Audit Logging

MySQL Triggers for WordPress Database Audit Logging

MySQL triggers as an audit log for WordPress options Some changes in a WordPress database come from nowhere: the admin email is suddenly different, users_can_register is on, a plugin appears in active_plugins. A logging plugin records what happens through WordPress, but not what a script, a database tool or an attacker with database access changes…