[wp-meta] [Making WordPress.org] #3894: Avoid expensive database queries from redirect_canonical on 404's

Making WordPress.org noreply at wordpress.org
Wed Oct 31 03:02:26 UTC 2018


#3894: Avoid expensive database queries from redirect_canonical on 404's
----------------------------+--------------------
 Reporter:  dd32            |      Owner:  (none)
     Type:  defect          |     Status:  new
 Priority:  normal          |  Milestone:
Component:  Support Forums  |   Keywords:
----------------------------+--------------------
 There's some URLs on the Support Forum which are triggering OOM fatal
 errors when requested, such as the following:

 https://wordpress.org/support/topic/test/*1*

 This is caused as it doesn't match an existing topic, and it causes
 WordPress to perform a query like this, which has thousands of results in
 the forums:

 {{{
 SELECT ID FROM wp_posts
 WHERE post_name LIKE '1%' AND post_type IN ('post', 'page', 'attachment',
 'forum', 'topic', 'reply', 'helphub_article', 'helphub_version') AND
 post_status = 'publish'
 }}}

 The following commit avoids these by requiring that the `name` query var
 is at least 5 characters long, which appears to be long enough to reduce
 the number of DB rows to avoid fatal errors while also allowing for
 redirects when a partial post_name is provided.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/3894>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list