If you’ve got 60,000 records, try cleaning post/page revisions; these really accumulate and cause excessively long queries. I’ve seen database sizes drop 90% with huge increases in performance.
Run the query below in phpmyadmin or from the command line and then optimize:
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type="revision"
Talk to your web host, too. Maybe MySQL or your CPU is being throttled down.
Related Posts:
- Using wpdb to connect to a separate database
- How to fetch Data in WordPress using MySQLi or $wpdb
- wpdb->insert multiple record at once
- WordPress database scalability from the code perspective
- How to define composite keys with dbDelta()
- WordPress for a very large website
- Inserting Post Meta From SQL
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- Why does dbDelta() not catch MysqlErrors?
- How to solve slow WordPress site caused by attachment_metadata
- What causes the “max_user_connections” warning on WordPress frontend?
- How to execute mulitple statement SQL queries using $wpdb->query?
- Which is more efficient? Using usermeta, or creating a new MySQL table?
- wpdb_prepare with multiple or condition
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Multiple wp_options tables to share content across installs
- Advanced SELECT query with condtional statements
- Improve performance by removing unnecessary database queries
- Redirecting to old domain after migration website
- Create table from array with prepare
- How to prevent/delay MySQL connections when an object cache is used?
- WordPress running SQL query to update database from form
- Have working sql query… trying to adjust it to use $wpdb
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Trouble running $wpdb->query() with last_insert_id
- Query Column of Specific ID from Database Table
- How to create more than one new wpdb object?
- Optimizing function that automatically creates internal links based on post title string
- How to connect and insert data in database of wordpress?
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- “BS_” rows in postmeta table
- Where is the HTML-handler part in the wpdb class?
- WordPress Database Query works in phpMyAdmin but not in the code
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- How To connect to the same WordPress database with different database user
- Mysql Queries per Visit – Crazy High
- using same mysql user with many databases
- Uploading to WordPress Database
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- WPDB Insert or if exists Update
- get_results using wpdb
- $wpdb won’t insert NULL into table column
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- WP_Options ID high
- WordPress database error: [Query was empty] [closed]
- Error establishing a database connection – with Debug Data
- Can I transfer a mysql database to another site?
- When and why should I use $wpdb different return types?
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- How wordpress accesses its own database
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- Is it safe to convert tables from MyISAM to InnoDB?
- Migrating database / content of non-CMS site to WordPress
- How to use a different database to list and manage comments in the backend
- Delete all post meta except featured image Using SQL
- How do I properly update the WordPress database password?
- Adding new row to wp_post table
- Show last modified date of database
- $wpdb->insert is not working
- WordPress Install and Database on separate hosting?
- Extracting the post_id via the wp_insert_post action (external db query)
- How do I get the posts within a certain year/date(with sql query)?
- Update from 4.5 to 4.6 failing
- fastest replacement DB
- Does auto_load to ‘no’ in wp_options improve performance
- Call to undefined function get_user_meta() – trying to access data in MySQL from custom fields
- Duplicated site isn’t recognized as a site
- Changing root password in PHPMyAdmin for WordPress Database when going live
- How to properly check if a table exists in WordPress Database using Show Tables Query
- creating new field on mysql
- $wpdb->query can’t insert data
- Problem migrating to localhost
- SQL query to set posts in bulk based on the post content
- How can I detect right db type?
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- Second ezSQL initialization for MSSQL
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Recovery – Restore Database after moving folder location locally
- Replacing javascript link in WordPress database without getting mysql syntax errors
- What is my error trying to create a new table in the database?
- Writing a function for WP Cron to run a SQL command daily
- Job and Employee Performance Tracking with Product Safety
- What structure and database storage method should I use for temporary storage that may be written concurrently?
- how to access 2nd Mysqli Database from different server for wordpress
- Using wpdb to connect to a different database is not working
- How to map data on CSV to web pages?
- Search and Replace in Windows XAMPP site
- About wp database hooks (error establishing connection)
- How to get specific table by current user login
- WordPress Database Posts Table query
- Should I Use only wpdb Class to Write Custom Queries?
- How to extract some part of WordPress full source code
- Why are my WordPress post queries so slow?
- MySQL database migration to WordPress
- Migrated to Namecheap, now Trouble with Database & wp-config [closed]
- PHP Warning: Error while sending QUERY packet
- WordPress database connection failed, while mysql client is working [closed]