Support » Fixing WordPress » Count User Slow Query By Query Monitor

  • Hello,

    I had query monitor in my website and it shows slow query in function count_user()
    check query here :

    SELECT COUNT(NULLIF(meta_valueLIKE '%\"administrator\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"editor\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"author\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"contributor\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"subscriber\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"customer\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"shop\\_manager\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"sales\\_manager\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"sales\\_operator\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"customer\\_care\"%', false)), COUNT(NULLIF(meta_valueLIKE '%\"finance\"%', false)), COUNT(NULLIF(meta_value` = ‘a:0:{}’, false)), COUNT(*)
    FROM bzb_usermeta
    INNER JOIN bzb_users
    ON user_id = ID
    WHERE meta_key = ‘bzb_capabilities’`

    and query path:
    count_users
    WP_Users_List_Table->get_views
    WP_List_Table->views

    Best Regards

    • This topic was modified 1 week, 2 days ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
  • You must be logged in to reply to this topic.