[wp-trac] [WordPress Trac] #23336: Sticky Posts lack sanity bounding. If used too much, can severely degrade performance.

WordPress Trac noreply at wordpress.org
Thu Jan 31 05:09:38 UTC 2013


#23336: Sticky Posts lack sanity bounding. If used too much, can severely degrade
performance.
-----------------------------+--------------------------
 Reporter:  markjaquith      |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Query
  Version:                   |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 Came across an issue where a site was using sticky posts for a slider on
 the front page. The rest of the front page used custom taxonomy queries.
 As such, they'd mark items as sticky, have the slider grab the first
 three. Over years, they accumulated thousands of sticky posts, which, as
 you can imagine, made the front page of their site absurdly slow, as it
 was querying those thousands of posts every time.

 Should we establish some sort of sanity limit here, to keep people from
 shooting themselves in the foot? I found this a REALLY hard issue to
 diagnose. Even with debug bar, there is no indication that sticky posts
 are being queried. There's just a giant WP_Query call that does a giant
 `IN()` query.

 Something like a limit of 100 with FIFO would keep things from getting too
 crazy, without restricting people too much. If you have a need for more
 than that, you need to be using a taxonomy query.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23336>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list