WordPress.org

Ready to get started?Download WordPress

Ideas

Moving "transient" rows to its own table

  1. Barış Ünver
    Member

    12345

    When working with the wp_options table, transients are always a burden. Plus, I don't think they belong to an "options" table.

    Don't you think it would be more logical if they were in a separate database table, maybe something like wp_temp?

    Posted: 1 year ago #
  2. Jonathan Dingman
    Member

    12345

    I could see how that would be useful, especially for a site that may have hundreds or thousands of transients.

    Posted: 1 year ago #
  3. Gestroud
    Member

    12345

    +1 It always annoys me to find transients loitering in my database. ;-)

    Posted: 1 year ago #
  4. Vlad Lasky
    Member

    12345

    A number of times, I have found hundreds of megabytes of expired WordPress transients littering clients' databases that have required manual removal followed by optimization to recover the space, i.e.

    DELETE FROM wp_options WHERE option_name LIKE '_transient_%' AND option_value < now();

    followed by

    OPTIMIZE TABLE wp_options;

    The WordPress team urgently needs to fix the transients implementation, to store them outside the options table and to remove them automatically after they have expired.

    In the case of the latter, I have found a few code snippets and a plugin to automatically remove them, but I don't think this is the best long-term approach:

    http://stackroulette.com/wordpress/6602/are-transients-garbage-collected

    http://wordpress.org/support/topic/does-wordpress-automatically-delete-transients?replies=4

    Posted: 1 year ago #
  5. webaware
    Member

    12345

    Also note these topics:

    Transient API should allow no expiry and no autoload

    Transient API should allow delete by prefix

    Having transients in the options table means that some may be autoloaded with other options, which can be a performance improvement if they are required on every page, but can impact memory requirements of WordPress if there are large transients with no expiry time.

    I think it's time to revisit the implementation of transients in WordPress.

    Posted: 1 year ago #
  6. Mike
    Member

    Agreed. Transient buildup has led to out-of-memory condition, crashing my site numerous times. I added some code to my functions.php to purge transients, as explained here: http://www.staze.org/wordpress-_transient-buildup/

    Now, I'm trying a recurring event in phpMyAdmin to do the same thing, using a command similar to what vlasky wrote.

    Then, as vlasky noted, I have to optimize the table, which I'm also doing on a scheduled basis with the WP-DBmanager plugin.

    Seems crazy that we have to jump through all these hoops to prevent transient buildup.

    Posted: 1 year ago #
  7. Barış Ünver
    Member

    12345

    I'm glad this idea is tagged "under consideration" :)

    Posted: 1 year ago #
  8. Unsal Korkmaz
    Member

    All new ideas have same "under consideration" tag. For idea: i dont agree. if we move transients to other table, wp_options will be basically unnecessary table imo. While loading wp_options's autload rows, why WP should load 2 tables instead 1?

    Posted: 1 year ago #
  9. Yakup Hoca
    Member

    I agree with Barış. Getting options fast is important than getting transitions. Since using transitions API, wp_options table has been garbage. If the tables is seperated, wp_options table will be used for its duty (to save options).

    Posted: 1 year ago #
  10. Ryan Hellyer
    Member

    AFAIK, the use of the options table is only a fallback for when users don't make use of an object caching backend. So long as an object caching backend is used, the options table should never be touched by the transients API. Due to this, I don't think it is necessary to have another database table especially for transients.

    Posted: 10 months ago #

RSS feed for this topic

Reply »

You must log in to post.

  • Rating

    12345
    12 Votes
  • Status

    This idea is under consideration