Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#17075 closed defect (bug) (invalid)

tag pages slow after 3.1.1. upgrade

Reported by: softclick Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1.1
Component: Taxonomy Keywords: reporter-feedback
Focuses: Cc:



Changes in /wp-includes/query.php make tag pages very slow, if there are many tagged posts.

Slow Query:

SELECT SQL_CALC_FOUND_ROWS wp1_posts.* FROM wp1_posts WHERE 1=1 AND ( wp1_posts.ID IN (select object_id from wp1_term_relationships where term_taxonomy_id in (754,281) GROUP BY object_id HAVING COUNT(object_id) = 2 ));

Change History (6)

#1 follow-up: @scribu
7 years ago

  • Keywords reporter-feedback added; needs-patch removed

By the look of that query, it seems to be a tag intersection: /tag/foo+bar and not a plain /tag/foo

If it's a tag intersection, this ticket is a duplicate of #16706.

If it's a plain tag archive, it means the tag is duplicated somehow.

Please clarify.

#2 in reply to: ↑ 1 @softclick
7 years ago

No, the problem happens with single-tag pages. (e.g. /tag/foo)

If we use the query.php of 3.1 everything is fine. (< 1 second) If we use the 3.1.1 version a tag-page with let's say 400+ depending posts takes "forever". (10-20 seconds)

Here is the output of the slow query log:

# Time: 110407 23:14:24
# User@Host: web1[web1] @ localhost []
# Query_time: 14  Lock_time: 0  Rows_sent: 10  Rows_examined: 14764793
SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND ( wp_posts.ID NOT IN (
                                        SELECT object_id
                                        FROM wp_term_relationships
                                        WHERE term_taxonomy_id IN (7106)
                                ) AND wp_posts.ID IN (
                                        SELECT object_id
                                        FROM wp_term_relationships
                                        WHERE term_taxonomy_id IN (7)
                                        GROUP BY object_id HAVING COUNT(object_id) = 1
                                ) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 20, 10;

#3 follow-up: @nacin
7 years ago

Any plugins?

#4 in reply to: ↑ 3 @softclick
7 years ago

Sorry, guys. Shame on me!

I switched off all of them. But that was not enough. Now, after you asked, I have renamed the plugin-folder to be bulletproof.

The problem is "sidebar photoblog".

I am sorry, that I stole your time. I know, what for a job that is. I support a forum hoster with 100.000 forums.

So if we see us real-life, you get some free beers!

Sunny regards from Germany,


#5 @nacin
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Not a problem. Typing out "Any plugins?" didn't take too much time :-)

#6 @softclick
7 years ago

But it made a big impact! TNX!

Note: See TracTickets for help on using tickets.