Opened 14 years ago
Closed 12 years ago
#15400 closed enhancement (fixed)
Recent comments widget triggers query for each post not in cache
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Ideally, we should reduce this to a single query.
Attachments (6)
Change History (26)
#1
@
14 years ago
- Milestone changed from 3.1 to Future Release
- Type changed from defect (bug) to enhancement
#3
@
14 years ago
- Keywords needs-patch added; 3.2-early removed
- Milestone changed from Future Release to 3.1
#5
@
14 years ago
- Keywords 3.2-early added
- Milestone changed from 3.1 to Future Release
Punting due to beta.
#6
follow-up:
↓ 14
@
14 years ago
I think in general this Widget makes too many queries as we also run queries for all the links to work out which page the comments are on when comment paging is enabled.
#8
@
14 years ago
I've reviewed your patch and have the following comments.
- You shouldn't directly access/delete cache objects from within the widget code
- It would be better to do two queries one to fetch the comments and one with get_posts to fetch and cache the posts.
#10
@
12 years ago
- Keywords needs-patch added; has-patch 3.2-early gci removed
- Milestone changed from Future Release to 3.5
We can now use _prime_post_caches() here.
#12
@
12 years ago
A term cache *might* be necessary if the permalink has term structures like %category%. I'm fine with the patch as is, but something to think about.
#13
@
12 years ago
I propose that we open another ticket to create something like a permalinks_include_terms()
function (which may have other uses elsewhere?), but otherwise land this for the time being. Nacin, thoughts?
#14
in reply to:
↑ 6
@
12 years ago
Replying to westi:
I think in general this Widget makes too many queries as we also run queries for all the links to work out which page the comments are on when comment paging is enabled.
I forgot about this part.
Sorry, I misread the 3.1 schedule. This can still go in until Nov. 15.