WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 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:

Description

http://wordpress.org/support/topic/tag-pages-slow-after-311-upgrade

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)

comment:1 follow-up: scribu3 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.

comment:2 in reply to: ↑ 1 softclick3 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;

comment:3 follow-up: nacin3 years ago

Any plugins?

comment:4 in reply to: ↑ 3 softclick3 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,

Sebastian

comment:5 nacin3 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 :-)

comment:6 softclick3 years ago

But it made a big impact! TNX!

Note: See TracTickets for help on using tickets.