WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Organize Series] Inefficient get_series_posts calls (3 posts)

  1. orbalon
    Member
    Posted 5 years ago #

    I love the concept of this plugin. Very useful even with this performance flaw. But would like to point it out for a more long term fix.

    It seems as though two query calls are made per series posts when pulling up a page which displays the series list/titles. So, if you have 20 titles/posts in a series, that means 40 queries.

    Heres an example of one set for a post:
    SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (493)
    SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (493) ORDER BY t.name ASC

    The reasoning for this seems to be in the required replace for the tag: %post_title_list%

    The function get_series_posts is being called for each posts. This is happening around line 300 in series-utility.php

    My work around for now was simply to create my own function with my own styling built into it. Thus avoiding the need for tags and more than 2 queries for any series list display.

    I imagine others will see the same performance as their series lists grow. Perhaps this will be fixed at a later date?

    Thanks much for your time on this plugin!

  2. Darren Ethier (nerrad)
    Member
    Posted 5 years ago #

    Just a heads up that I'm working on a release of Organize Series that I hope to have out by the end of August that will fix this issue. I still would like to reduce the number of db queries that orgSeries uses overall, but with the upcoming fix, increasing the number of posts in a series will NOT increase the db queries when rendering (ONE query for all posts instead of a query for each).

    Thanks again for pointing this out - it helped me spot where the code could be more efficient!

    The problem was actually in the function set_series_order().

  3. Darren Ethier (nerrad)
    Member
    Posted 4 years ago #

    The new release of organize series is out. I think I've taken care of some of the inefficiency

Topic Closed

This topic has been closed to new replies.

About this Topic