Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/05/2012 05:32:33 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Performance:

  • Add 'numeric' to applicable meta-queries to avoid casting as char.
  • Remove meta-queries, and use post_parent where possible.
  • Introduce _bbp_has_replies_where() filter, attached to 'posts_where' which is responsible for adding the lead topic to the results. This avoids having to use a costly meta-query, potentially resulting in full table scans.
  • Audit meta-queries, and tweak where needed.
  • Fixes #1885.
  • Props vibol for investigation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-common-functions.php

    r4034 r4059  
    14711471                            'key'     => '_bbp_forum_id',
    14721472                            'value'   => $forum_id,
     1473                            'type'    => 'numeric',
    14731474                            'compare' => '='
    14741475                        ) );
     
    15011502                            'feed'           => true,
    15021503                            'post_type'      => bbp_get_topic_post_type(),
    1503                             'post_parent'    => 'any',
     1504                            'post_parent'    => $forum_id,
    15041505                            'post_status'    => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ),
    15051506                            'posts_per_page' => bbp_get_topics_per_rss_page(),
    1506                             'order'          => 'DESC',
    1507                             'meta_query'     => $meta_query
     1507                            'order'          => 'DESC'
    15081508                        );
    15091509
     
    15501550
    15511551                        // Output the feed
    1552                         bbp_display_replies_feed_rss2();
     1552                        bbp_display_replies_feed_rss2( array( 'feed' => true ) );
    15531553
    15541554                    // All topics
Note: See TracChangeset for help on using the changeset viewer.