Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: store donation meta data results under correct cache key #3359

Closed
ravinderk opened this issue Jun 13, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@ravinderk
Copy link
Collaborator

commented Jun 13, 2018

Bug Report

User Story

As an admin, I want my website to load faster, but currently, I am seeing additional meta queries on each page load ( Query Monitor ).

ref: https://secure.helpscout.net/conversation/759921560/0/?folderId=672194

Current Behavior

We are using WP_Query to get donations or form then by default WordPress loads metadata of each donation to cache within post_meta key.

https://github.com/WordPress/WordPress/blob/32ee2ed5734357d5faa5537d9916ada07f672eaf/wp-includes/meta.php#L888

We have custom meta table for donation and form, so whenever we do meta query then we define meta_type and it is used to search meta query result in cache. We always get cache miss because cache always store under post_meta key instead of donation_meta
https://github.com/WordPress/WordPress/blob/32ee2ed5734357d5faa5537d9916ada07f672eaf/wp-includes/meta.php#L520

We can reduce a lot of query by storing meta cache under correct cache key.

Acceptance Criteria

  • Meta query result does store into correct meta cache object. For example, meta cache stores into donation_meta if meta type is donation
  • Meta cache updates when editing donation

@ravinderk ravinderk changed the title perf(query): improve meta query performance perf: improve meta query performance Jan 28, 2019

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Jan 28, 2019

@ravinderk Please complete the issue template so we can understand how this affects the user. It's unclear whether this affects front end or back end performance, or both. Every issue also needs acceptance criteria.

@ravinderk

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 28, 2019

@kevinwhoffman This was an old issue which I created. I added few lines to remind myself. I will update this by tomorrow

@ravinderk ravinderk changed the title perf: improve meta query performance perf: store meta data results under correct cache key Jan 30, 2019

@ravinderk ravinderk changed the title perf: store meta data results under correct cache key perf: store donation meta data results under correct cache key Jan 31, 2019

@ravinderk

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 31, 2019

@kevinwhoffman I changed the title and scope of this issue. We will fix donation meta cache related issue in this and i will add another issue for form and donor

DevinWalker added a commit that referenced this issue Feb 1, 2019

Merge pull request #3976 from impress-org/issue/3359
perf: store donation meta data results under correct cache key #3359

@ravinderk ravinderk closed this Feb 4, 2019

@ravinderk

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 7, 2019

reopening this issue to test again with #3983 and #3982

@ravinderk ravinderk reopened this Feb 7, 2019

@ravinderk ravinderk referenced this issue Feb 12, 2019

Merged

Meta query performance #3359 #3382 #3383 #3997

3 of 3 tasks complete

DevinWalker added a commit that referenced this issue Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.