Sticky Posts lack sanity bounding. If used too much, can severely degrade performance.
|Reported by:||markjaquith||Owned by:|
|Severity:||normal||Keywords:||has-patch, reporter-feedback, close, stickies|
|Cc:||ian_dunn@…, kovshenin, mboynes@…, mike@…|
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.