• Resolved kevink231

    (@kevink231)


    I have a WordPress site with a large user db more than 1 million users.

    I am seeing a slow query in the logs and it looks like this:

    SELECT wp_users.ID
    FROM wp_users INNER JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id )
    WHERE 1=1 AND (
    ( wp_usermeta.meta_key = ‘wp_user_level’ AND wp_usermeta.meta_value != ‘0’ )
    )
    ORDER BY display_name ASC
    LIMIT 0, 50;

    I want to find what is triggering it and stop it from executing this query. (Listing admins and authors is not something I’m intending on using.

    I have already tried the below with no luck:

    add_action(‘init’, function () {
    foreach ([‘page’, ‘post’, ‘wh_jobs’, ‘wh_edu’, ‘wh_glossary’] as $type) {
    remove_post_type_support($type, ‘author’);
    }
    });

    I suspect that this is likely triggered by someone browsing posts or writing something in wp-admin

Viewing 1 replies (of 1 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    As much as I’d like to, I can’t help fix issues on your site that QM tells you about. It would be a full time job for me.

    You might want to post on the main support forum or do some searching for the problem, you’re not the first person to experience this with a large user table.

    Best of luck.

Viewing 1 replies (of 1 total)

The topic ‘Slow Query in WordPress’ is closed to new replies.