• Resolved Malcolm Peralty

    (@phoenixfireball)


    When I edit a certain post, it takes forever for RankMath to load all the way, and I get this information in the Status and Tools section:

    [14-Mar-2022 23:14:36 UTC] WordPress database error Unknown column 'defaultdb' in 'where clause' for query SELECT SUM((data_length + index_length)) AS size FROM information_schema.TABLES WHERE table_schema="defaultdb" AND (table_name="wp_rank_math_404_logs") made by do_action('rank-math_page_rank-math-status'), WP_Hook->do_action, WP_Hook->apply_filters, MyThemeShop\Admin\Page->display, include_once('/plugins/seo-by-rank-math/includes/modules/status/views/main.php'), RankMath\Status\Status->display_body, RankMath\Status\System_Status->display, RankMath\Status\System_Status->prepare_info, RankMath\Status\System_Status->get_table_size, QM_DB->query
    [14-Mar-2022 23:14:36 UTC] WordPress database error Unknown column 'defaultdb' in 'where clause' for query SELECT SUM((data_length + index_length)) AS size FROM information_schema.TABLES WHERE table_schema="defaultdb" AND (table_name="wp_rank_math_redirections") made by do_action('rank-math_page_rank-math-status'), WP_Hook->do_action, WP_Hook->apply_filters, MyThemeShop\Admin\Page->display, include_once('/plugins/seo-by-rank-math/includes/modules/status/views/main.php'), RankMath\Status\Status->display_body, RankMath\Status\System_Status->display, RankMath\Status\System_Status->prepare_info, RankMath\Status\System_Status->get_table_size, QM_DB->query
    [14-Mar-2022 23:14:36 UTC] WordPress database error Unknown column 'defaultdb' in 'where clause' for query SELECT SUM((data_length + index_length)) AS size FROM information_schema.TABLES WHERE table_schema="defaultdb" AND (table_name="wp_rank_math_redirections_cache") made by do_action('rank-math_page_rank-math-status'), WP_Hook->do_action, WP_Hook->apply_filters, MyThemeShop\Admin\Page->display, include_once('/plugins/seo-by-rank-math/includes/modules/status/views/main.php'), RankMath\Status\Status->display_body, RankMath\Status\System_Status->display, RankMath\Status\System_Status->prepare_info, RankMath\Status\System_Status->get_table_size, QM_DB->query
    [14-Mar-2022 23:14:36 UTC] WordPress database error Unknown column 'defaultdb' in 'where clause' for query SELECT SUM((data_length + index_length)) AS size FROM information_schema.TABLES WHERE table_schema="defaultdb" AND (table_name="wp_rank_math_internal_links") made by do_action('rank-math_page_rank-math-status'), WP_Hook->do_action, WP_Hook->apply_filters, MyThemeShop\Admin\Page->display, include_once('/plugins/seo-by-rank-math/includes/modules/status/views/main.php'), RankMath\Status\Status->display_body, RankMath\Status\System_Status->display, RankMath\Status\System_Status->prepare_info, RankMath\Status\System_Status->get_table_size, QM_DB->query
    [14-Mar-2022 23:14:36 UTC] WordPress database error Unknown column 'defaultdb' in 'where clause' for query SELECT SUM((data_length + index_length)) AS size FROM information_schema.TABLES WHERE table_schema="defaultdb" AND (table_name="wp_rank_math_internal_meta") made by do_action('rank-math_page_rank-math-status'), WP_Hook->do_action, WP_Hook->apply_filters, MyThemeShop\Admin\Page->display, include_once('/plugins/seo-by-rank-math/includes/modules/status/views/main.php'), RankMath\Status\Status->display_body, RankMath\Status\System_Status->display, RankMath\Status\System_Status->prepare_info, RankMath\Status\System_Status->get_table_size, QM_DB->query
    [14-Mar-2022 23:14:36 UTC] WordPress database error Unknown column 'defaultdb' in 'where clause' for query SELECT SUM((data_length + index_length)) AS size FROM information_schema.TABLES WHERE table_schema="defaultdb" AND (table_name="wp_rank_math_analytics_objects") made by do_action('rank-math_page_rank-math-status'), WP_Hook->do_action, WP_Hook->apply_filters, MyThemeShop\Admin\Page->display, include_once('/plugins/seo-by-rank-math/includes/modules/status/views/main.php'), RankMath\Status\Status->display_body, RankMath\Status\System_Status->display, RankMath\Status\System_Status->prepare_info, RankMath\Status\System_Status->get_table_size, QM_DB->query

    I have cleared cache, cleared transients, and looked for other potential issues. Any insights or ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @phoenixfireball,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    Please follow this guide to re-create any missing database tables from your installation: https://rankmath.com/kb/recreate-missing-database-tables/

    Wait a couple of minutes for the process to finish and then try again saving the post/page that was giving this error.

    Hope this helps solve your issues.

    Don’t hesitate to get in touch if you have any other questions.

    Thread Starter Malcolm Peralty

    (@phoenixfireball)

    I’ve tried that, but the issue is that there are no tables that are set to table_schema=”defaultdb” I’m not sure where it’s getting that defaultdb value, but it shouldn’t be that.

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @phoenixfireball

    The error you are getting is in the query which we use to calculate the Table size on the Status & Tools page. It should not slow down the Post page because this query only runs on the Status & Tools page.

    The defaultdb in table_schema="defaultdb" is the Database name. We use $wpdb->dbname; to get the Database name.

    To me, it looks like something is wrong in the DB because the SELECT query is seeing the value mentioned in the table_schema as a column.

    Can you please take a complete backup of Rank Math tables, delete and then regenerate them again using the Database tools?

    As far as the page freezing issue is concerned, since you mentioned that this happens only on certain posts, can you please share the content, title, and focus keyword used on the post(s) so we could reproduce this issue on our local setup?

    Looking forward to helping you. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Slow RankMath And Missing DB?’ is closed to new replies.