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
- SQL errors when querying for something with apostrophes
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- MySQL SELECT increment counter
- phpMyAdmin – Error > Incorrect format parameter?
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- MySQL Database User: Which Privileges are needed?
- Why is my database import losing text widget data?
- WPDB Insert or if exists Update
- How to return number of found rows from SELECT query
- get_results using wpdb
- Will it break my site if I delete all transient records in wp_options table?
- Checking if Database Table exists
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- $wpdb won’t insert NULL into table column
- Please explain how WordPress works with MySQL character set and collation at a low level
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- Get error messages when $wpdb->insert() returns false?
- Detecting errors generated by $wpdb->get_results()
- Does dbDelta delete columns as well?
- wpdb update add current timestamp not working
- WordPress Database lost auto increment
- Connect to database using wordpress wp-config file
- Reset Post IDs to less than 64bit integer
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Restoring WordPress posts from database only
- WordPress Unit Testing – Cannot Create Tables
- Does wpdb add considerable overhead on queries with large result sets?
- Is it possible to define two databases for one installation?
- Why does $wpdb return strings for mysql integer values?
- Does WordPress use the InnoDB engine for MySQL by default?
- $wpdb->prepare() warning in WordPress 3.5
- find a random blogid across my multisite network that has at least one post published
- Slow wp_term_relationships query
- $wpdb->delete column values IN ARRAY()?
- How to use “TRUNCATE TABLE” MySQL statement?
- Inserting data into custom tables
- Hook into $wpdb
- Can I use MariaDB instead of MySQL in wordpress?
- Display data from a non wordpress database on a page template
- How does $wpdb handle COUNT(*)
- Performance tips for a large user base [closed]
- How might I retrieve a featured post image from an external WP site and display it as a link back?
- Slow SQL_CALC_FOUND_ROWS Query
- WP_Options ID high
- WordPress database error: [Query was empty] [closed]
- Export wordpress table to excel
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- How to close wpdb connection? [duplicate]
- What are conventions about the schema of the $table_prefix
- Split WP install between 2 databases?
- WordPress database becoming huge. How to analyze and optimize it? fear of running out of memory
- Improve or optimize a very slow query
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- Connecting to external oracle database
- Efficiency on displaying random authors based on large database
- Is deleting orphaned wp_options entries safe?