Changes between Initial Version and Version 1 of Ticket #22742
- Timestamp:
- 12/04/2012 09:36:32 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22742 – Description
initial v1 6 6 7 7 In my page->feed conversion, I was curious what the performance implications were. I figured with less files and functions (related to the theme layer) involved, it could only be better using a feed. Not so, it was worse at about 5x to run the same feed creating logic. I sat down with xdebug and query logging to figure out what was going on and found that there were a few extra queries being run on the feed side: 8 8 {{{ 9 9 SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment', 'story') ORDER BY post_modified_gmt DESC LIMIT 1; 10 10 SELECT post_date_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment', 'story') ORDER BY post_date_gmt DESC LIMIT 1; 11 11 SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 50; 12 12 SELECT FOUND_ROWS(); 13 13 }}} 14 14 These are coming from a branch in /wp-includes/class-wp.php WP::send_headers(). It's doing very basic logic to determine via the query string if we expect this request to be a feed, then it uses either ''get_lastcommentmodified()'' or ''get_lastpostmodified()'' and uses the result of that to set and send some headers for last modified and etag, and evaluate request values for conditional get (304) responses. 15 15 … … 32 32 '''I've noticed a little discussion on this issue elsewhere:''' 33 33 34 http://core.trac.wordpress.org/ticket/19466 - This person is attempting to apply the existing logic--page/comment last modified across every request which would be a massive mistake. Assuming that's why there has been no response.34 #19466 - This person is attempting to apply the existing logic--page/comment last modified across every request which would be a massive mistake. Assuming that's why there has been no response. 35 35 36 http://core.trac.wordpress.org/ticket/15499 - This person is suggesting an index to get the results quicker--that could be beneficial additionally, but perhaps my modifications could reduce the need for such an index.36 #15499 - This person is suggesting an index to get the results quicker--that could be beneficial additionally, but perhaps my modifications could reduce the need for such an index.