db performance on recent posts

Elite
  • 31 points
    Starting to get into this DEV thing
    I'm helpful
    Tomas

    Member  —  9th November 2011         

    Hi, we display 10 recent posts from across the blogs in every blogs sidebar.
    I can see that MySQL logs these slow queries repetedly:

    # Time: 111109 15:26:28
    # User@Host: dbuser[dbuser] @  [217.25.39.14]
    # Query_time: 17.410294  Lock_time: 1.244156 Rows_sent: 0  Rows_examined: 196877
    SET timestamp=1320848788;
    SELECT site_post_id FROM wp_site_posts WHERE post_id = '186436' AND blog_id = '2317';
    # User@Host: dbuser[dbuser] @  [217.25.39.16]
    # Query_time: 11.586513  Lock_time: 0.000072 Rows_sent: 10  Rows_examined: 196887
    SET timestamp=1320848788;
    SELECT * FROM wp_site_posts WHERE blog_public = '1' ORDER BY post_published_stamp DESC LIMIT 10;
    # User@Host: dbuser[dbuser] @  [217.25.39.14]
    # Query_time: 16.620471  Lock_time: 0.000100 Rows_sent: 0  Rows_examined: 196877

    I'm no expert in this are but would you say we have performance issues?

    Thanks
    Tomas