Opened 15 years ago
Closed 12 years ago
#11423 closed enhancement (fixed)
user_nicename should get memcached
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Optimization | Keywords: | has-patch |
Focuses: | Cc: |
Description
When displaying an author's page, there are queries:
SELECT ID FROM users WHERE user_nicename='whoever' SELECT display_name FROM users WHERE user_nicename = 'whoever'
the second one could be avoided with a non-persistent cache bucket indexed on user_nicename. we could store the user_id, for instance.
both of them could be avoided with the same bucket if the latter is made persistent.
Attachments (2)
Change History (15)
#3
@
15 years ago
I did not look into the code but couldn't both values (ID, display_name) selected with one query? Wouldn't that solve the job as well?
#4
follow-up:
↓ 5
@
15 years ago
something like merging
SELECT ID FROM users WHERE user_nicename='whoever' SELECT display_name FROM users WHERE user_nicename = 'whoever'
into
SELECT ID, display_name FROM users WHERE user_nicename = 'whoever'
#5
in reply to:
↑ 4
@
15 years ago
Replying to hakre:
something like merging
SELECT ID FROM users WHERE user_nicename='whoever'
SELECT display_name FROM users WHERE user_nicename = 'whoever'
into
SELECT ID, display_name FROM users WHERE user_nicename = 'whoever'
Those queries are in separate files.
#6
@
15 years ago
not sure what you guys are discussing... the suggested patch strips the two queries already with memcached enabled. :-)
#9
@
15 years ago
- Keywords needs-refresh added; commit removed
- Milestone changed from 3.0 to Future Release
Due to [14160]
#10
@
15 years ago
- Keywords dev-feedback needs-testing added; needs-refresh removed
- Milestone changed from Future Release to 3.0
#12
@
12 years ago
- Keywords close added; dev-feedback needs-testing removed
From general-template.php:
// If there's an author if ( is_author() ) { $author = get_queried_object(); $title = $author->display_name; }
get_queried_object()
calls get_userdata()
which calls get_user_by()
. get_user_by()
does the caching, see [10992].
actually, it does get memcached:
so we should use it in WP query and for the display_name.