The MU forums have moved to WordPress.org

wp_load_alloptions() ignores autoload, leads to huge problems (6 posts)

  1. re5et
    Member
    Posted 14 years ago #

    In wpmu (not wp) the wp_load_alloptions function ignores autoload when selecting. This leads to massive waste. At the moment this query is returning over 1mb each time. Since this has been implemented (2.2 i think) the amount of data getting pulled out of my database has tripled.

    The bulk of the data in the options table that is making this so painful seems to be magpie content that is pulled from the developer blogs or something. It is not used (for the most part) an just sits there.

    A few questions to this end:

    1. is this an oversight?
    2. if not, why do this?
    3. can i disable the rss feeds that generate all of this data that i have no user for?
    4. if not whereabouts in the code might i comment out the functionality that updates this?
    5. if i alter the query in the wp_load_alloptions function to behave more like it does in wp (only selecting autoload = yes) does anyone foresee any nasty surprises in my future?

    thank you in advance.

  2. andrea_r
    Moderator
    Posted 14 years ago #

    File a trac tickets with as many details as possible:

    http://trac.mu.wordpress.org

    Login is upper right, use the same user/pass as you do here.

  3. cafespain
    Member
    Posted 14 years ago #

    Disable the RSS feeds on your dashboard and that will stop the feeds being updated, after which you can remove their information from the options tables.

  4. re5et
    Member
    Posted 14 years ago #

    @cafespain

    The only place that seems to refer to this is the "screen options" pulldown on the dashboard. Will un-checking this here actually stop it from fetching updates?

  5. cafespain
    Member
    Posted 14 years ago #

    It should do, they only seem to call the RSS fetching code just before being displayed.

    If you want to be sure though and feel capable, you can put together a quick plugin (to be placed in mu-plugins for site wide use) - use this function:

    http://blog.clearskys.net/2009/04/28/removing-wordpress-dashboard-widgets/

  6. re5et
    Member
    Posted 14 years ago #

    ewwwwwwwwwwwwwwwwwwww.

    If you alter the wp_load_alloptions function as above so that it only loads options marked as autoload, you can never get options that are marked as autoload = no.

    The get_option function first checks to see if the all options cache has been built, and if it has not been, _get_options_cache / wp_load_alloptions is called to build it. The all options cache is then checked for the setting requested, and if it is not in there, it just returns false. In wordpress, if the option is not in the cache it runs a query on that row to get it, just case it was an autoload = no.

    This basically boils down to autoload having absolutely no purpose in the current version of wpmu.

About this Topic