WordPress.org

Ready to get started?Download WordPress

Forums

A really huge database (5,00,000 posts) : The front end works fine (7 posts)

  1. champ_rock
    Member
    Posted 4 years ago #

    Hi

    I have a wordpress blog having about 5,00,000 posts. The website works fine (I have a good server which is optimised well). But the admin panel edit.php file which lists the posts takes a lot of time to load. (more than 15seconds).I think this is because when I open http://site/wp-admin/edit.php it sorts the entire 5,00,000 posts according to date. Otherwise, everything works absolutely fine (editing posts, creating new posts everything is superfine!)

    So, is there any way to speed this admin panel edit.php up? I dont want to wait 15seconds. May be if automatic sorting according to date is removed and that page lists the last 10 posts in the default order then it will become fine.

    Any opinions?

    (PS. : If its a paid plugin etc, then I am willing to buy it. )

  2. I assume you have the screen options in dashboard set to display only the last ten posts. I don't know about modifying or working on edit.php, but have you worked on reducing the size of the database itself by deleting post revisions?

    Run this SQL query to delete revisions (only after you have good backups on a database that size!):

    DELETE a,b,c
    FROM wp_posts a
    LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
    LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
    WHERE a.post_type = 'revision'
  3. champ_rock
    Member
    Posted 4 years ago #

    ya. I use Wp-optimise plugin. It deletes post revisions. that is not an issue.

  4. Mike Schinkel
    Member
    Posted 4 years ago #

    Have you tried modifying line 826 of /wp-admin/post.php temporarily to remove the orderby clause to diagnose to see if that solves the performance problem?

    From:

    wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");

    To:

    wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page");

    If it fixed it then you'll know what you need to do is figure out what hook you need to call in order to trap this problem. If not, you know it's not the sorting of dates.

    Let me know if it helped, please.

  5. champ_rock
    Member
    Posted 4 years ago #

    /wp-admin/post.php doesnt have 800 lines at all. I cant find the code that you mentioned in that file.

  6. Denis de Bernardy
    Member
    Posted 4 years ago #

    You are:

    - missing indexes in your database.
    - running into with WP ticket #11375: http://core.trac.wordpress.org/ticket/11375

    In short, with this amount of posts, it is absolutely necessary to optimize the daylights out of your queries, in order to make sure that an index is always used. Else you end up sorting temporary tables.

    Also, make sure you use memcached.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.