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

_wc_square_credit_card_* order meta data and performance #78

Open
AlchemyUnited opened this issue Feb 27, 2024 · 0 comments
Open

_wc_square_credit_card_* order meta data and performance #78

AlchemyUnited opened this issue Feb 27, 2024 · 0 comments
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement.

Comments

@AlchemyUnited
Copy link

This isn't a bug per se, tho' it likely could be a performance issue on sites with an uber number of orders.

Backstory: After doing a HPOS sync on a dev site I went poking around in the DB to verify all went as expected. When I looked in the new table: wp_wc_orders_meta I noticed there are ~15 rows with keys of wc_square_credit_card*.

Those along with another "rouge" plugin are making up approx half the rows of order meta in that table. The point being, if everyone is going to be sloppy about using the meta table, that table is going to get (unnecessarily) bloated. That is, each plugin can't be thinking, "oh I only have a few rows that could be less, but whatever. Who cares?"

My gut says most of the wc_square_credit_card* row could be a single row with the value being an array of value pairs. I mean, most of these rows don't look to be operational (i.e., needing to be queried directly), or they even get updated once written (so reading a single row to pull out some values to display from an array is low overhead when compared to DB row bloat.

Again, on small sites this is minor, but on large sites 15 rows that could be 5 or less does add up. Maybe there are a couple meta keys that do need to have their own rows, but not all of them, eh?

Maybe? Maybe not?

@vikrampm1 vikrampm1 added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement. labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants