Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress many slow querys


  • yesbutmaybeno
    Participant

    @yesbutmaybeno

    This is Buddypres 7.2.1 btw

    Any ideas where this is being called and any way to tweak it to force it to use another index?

    For some reason, it’s using date_recorded as the index, thus causing these 1,2,3+ second queries.

    They look like this:

    SELECT DISTINCT a.id  FROM wp_bp_activity a  WHERE  
    ( 
    	( 
    		a.user_id IN ( 457,4233,6113,4562,47,5954,5530,5149,5160,5500,6436 ) 
    		AND 
    		a.hide_sitewide = 0
    	)
    
    )
     AND a.is_spam = 0 AND a.type NOT IN ('activity_comment', 'last_activity') ORDER BY a.date_recorded DESC, a.id DESC LIMIT 15, 16;
     
     
     ///////////////
     
      
     SELECT DISTINCT a.id  FROM wp_bp_activity a  WHERE  
    ( 
    	( 
    		a.user_id IN ( 5137,4581 ) 
    		AND 
    		a.hide_sitewide = 0
    	)
    
    )
    
     AND a.is_spam = 0 AND a.type NOT IN ('activity_comment', 'last_activity') ORDER BY a.date_recorded DESC, a.id DESC LIMIT 0, 16;
     
     
     ///////////////
     
     
     SELECT DISTINCT a.id  FROM wp_bp_activity a  WHERE  
    ( 
    	( 
    		a.user_id IN ( 34806 ) 
    		AND 
    		a.hide_sitewide = 0
    	)
    
    )
    
     AND a.is_spam = 0 AND a.type NOT IN ('activity_comment', 'last_activity') ORDER BY a.date_recorded DESC, a.id DESC LIMIT 60, 16;
Viewing 4 replies - 1 through 4 (of 4 total)

  • yesbutmaybeno
    Participant

    @yesbutmaybeno

    Appreciate any insights! 😀


    yesbutmaybeno
    Participant

    @yesbutmaybeno

    pls 😀


    MarySeery
    Participant

    @maryseery

    Nice


    fawp
    Participant

    @fawp

    @yesbutmaybeno I ran a quick search on this query (I did it on BP 8.0.0, I don’t imagine it that different from 7.2.1 but keep this in mind).

    If by ‘Any ideas where this is being called’ you mean which file this is contained by, it seems to originate from bp-activity/classes/class-bp-activity-activity.php

    In a few instances this is inside an apply_filters hook, so there may be a chance you can hook into that and change the index to something else.

    Hope this helps some.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar