#8057 closed defect (bug) (fixed)
get_comments() needs to cache
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.7 | Priority: | normal |
| Severity: | normal | Version: | 2.7 |
| Component: | Optimization | Keywords: | needs-patch |
| Focuses: | Cc: |
Description
Reported by Mark.
get_comments() needs to use the internal cache, even if it's just caching the results of that particular SQL query.
get_page_of_comment() uses get_comments() to get all comments of the single comment's post so it can loop through them and calculate what page that comment will be on. Each call to get_page_of_comment() (and there's a lot due to get_comment_link()) currently results in a MySQL query.
Ouch.
Change History (6)
#2
@
17 years ago
- Component changed from Comments to Optimization
- Milestone changed from 2.7 to 2.9
- Owner set to anonymous
- Priority changed from highest omg bbq to normal
- Severity changed from critical to normal
Currently working on a patch to avoid using get_page_of_comment() as much and for get_page_of_comment() to avoid using get_comments() altogether (it'll still use a query though, but it'll be a much lighter one).
#3
@
17 years ago
Done: http://trac.wordpress.org/ticket/7956#comment:17
It'd still be nice if get_comments() cached, but it's no longer a big deal and doesn't need to be done for 2.7
In short: calling
get_comments()10 times with the same parameters should result in only one SQL query I think.