_wc_square_credit_card_* order meta data and performance #78
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.
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?
The text was updated successfully, but these errors were encountered: