Originally published at: LearnDash Slow Database Queries and Poor Database Design - Managing WP
Introduction Working on a LearnDash site for a client, I noticed some long running queries within the MySQL Slow log and PHP FPM slow log. PHP Slow Log [09-Aug-2024 16:18:04] [pool domain.com80] pid 646207 script_filename = /var/www/domain.com/htdocs/wp-admin/admin-ajax.php [0x00007f78e9c13a30] mysqli_query() /var/www/domain.com/htdocs/wp-includes/class-wpdb.php:2349 [0x00007f78e9c139c0] _do_query() /var/www/domain.com/htdocs/wp-includes/class-wpdb.php:2263 [0x00007f78e9c138e0] query() /var/www/domain.com/htdocs/wp-content/plugins/query-monitor/classes/DB.php:29 [0x00007f78e9c13820] query() /var/www/domain.com/htdocs/wp-includes/class-wpdb.php:3146 [0x00007f78e9c13730] get_results() /var/www/domain.com/htdocs/wp-content/plugins/sfwd-lms/includes/ld-reports.php:1135 [0x00007f78e9c13510] learndash_reports_get_activity() /var/www/domain.com/htdocs/wp-content/plugins/learndash-propanel/includes/class-ld-propanel-progress-chart.php:234…
Thanks so much for this article, Jordan. We’re experiencing the same issue on a Learndash site with very large user_activity table.
I was curious about one thing. We are planning to try O. Jones/R. James plugin Index WP MySQL For Speed. But in that stackoverflow, did O. Jones mean with his comment about looking at that Learndash table that his plugin couldn’t index it?
Please leave comments below!