[wp-trac] [WordPress Trac] #14090: the_tags never caches
WordPress Trac
wp-trac at lists.automattic.com
Fri Jul 2 15:41:44 UTC 2010
#14090: the_tags never caches
--------------------------+-------------------------------------------------
Reporter: luke83 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 3.0
Severity: normal | Keywords: cache, tags
--------------------------+-------------------------------------------------
Changes (by luke83):
* cc: luctre@… (added)
Comment:
Replying to [comment:1 ryan]:
> If the posts in question weren't fetched with get_posts() then that will
happen. Posts fetched with get_posts() will call
update_object_term_cache() so that taxonomy for all posts can be retrieved
with one query.
Hi ryan,
i have a fresh wp install with only WP File Cache plugin to handle
caching, i'm a bit confused, in my home i got this (you can see it uses
get_posts()):
{{{
12 queries
1. SELECT SQL_CALC_FOUND_ROWS wp_posts.* 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, 10 [0.0012137889862061]
require, wp, WP->main, WP->query_posts, WP_Query->query,
WP_Query->get_posts
2. SELECT FOUND_ROWS() [0.0011308193206787]
require, wp, WP->main, WP->query_posts, WP_Query->query,
WP_Query->get_posts
3. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (141) ORDER BY t.name ASC
[0.014594078063965]
require, require_once, include, get_template_part, locate_template,
load_template, require, post_class, get_post_class, get_the_tags,
get_the_terms, wp_get_object_terms
4. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (141) ORDER BY t.name ASC
[0.018500804901123]
require, require_once, include, get_template_part, locate_template,
load_template, require, get_the_tag_list, get_the_term_list,
get_the_terms, wp_get_object_terms
5. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (140) ORDER BY t.name ASC
[0.0010030269622803]
require, require_once, include, get_template_part, locate_template,
load_template, require, post_class, get_post_class, get_the_tags,
get_the_terms, wp_get_object_terms
6. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (140) ORDER BY t.name ASC
[0.00054287910461426]
require, require_once, include, get_template_part, locate_template,
load_template, require, get_the_tag_list, get_the_term_list,
get_the_terms, wp_get_object_terms
7. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (139) ORDER BY t.name ASC
[0.00051283836364746]
require, require_once, include, get_template_part, locate_template,
load_template, require, post_class, get_post_class, get_the_tags,
get_the_terms, wp_get_object_terms
8. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (139) ORDER BY t.name ASC
[0.00049591064453125]
require, require_once, include, get_template_part, locate_template,
load_template, require, get_the_tag_list, get_the_term_list,
get_the_terms, wp_get_object_terms
9. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (105) ORDER BY t.name ASC
[0.00055694580078125]
require, require_once, include, get_template_part, locate_template,
load_template, require, post_class, get_post_class, get_the_tags,
get_the_terms, wp_get_object_terms
10. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (105) ORDER BY t.name ASC
[0.0008690357208252]
require, require_once, include, get_template_part, locate_template,
load_template, require, get_the_tag_list, get_the_term_list,
get_the_terms, wp_get_object_terms
11. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (1) ORDER BY t.name ASC
[0.00066900253295898]
require, require_once, include, get_template_part, locate_template,
load_template, require, post_class, get_post_class, get_the_tags,
get_the_terms, wp_get_object_terms
12. SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON
tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN
('post_tag') AND tr.object_id IN (1) ORDER BY t.name ASC
[0.00062394142150879]
require, require_once, include, get_template_part, locate_template,
load_template, require, get_the_tag_list, get_the_term_list,
get_the_terms, wp_get_object_terms
}}}
is there something i can check or some plugin i can use to fix it?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14090#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list