Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Case is like that: price for products (line items) is not used. Commerce is used only for ordering items, no payment is done here. All products have price 0 and some random currency.
Values in those tables are unnecessary:
field_data_commerce_total
field_data_commerce_unit_price
field_revision_commerce_total
field_revision_commerce_unit_price
Is it possible to totally disable pricing for items? DB grows +/-40mb per week with this unwanted "empty" values.
If not is it possible to truncate those tables (periodically with cron) without any harm to order (also order editing)?
Comments
Comment #2
rszrama CreditAttribution: rszrama commentedIt's not really possible - so much of Commerce assumes price fields exist and have values. You might get away with unsetting them on save and supplying default $0 values on load. Otherwise you might just need to eat the size cost. Are you really getting 40M of just price field data? That seems quite high, and if so, you'd have hundreds of MB of data from the other field tables in the same timeframe - just dropping the unit prices wouldn't make a huge difference.
Comment #3
pawel_r CreditAttribution: pawel_r commentedThank you.
Site gets 12k-30k new commerce orders per week. We are trying to get db as slim as it is possible.
Unsetting and proving default values on load seems legit solution.
Comment #4
rszrama CreditAttribution: rszrama commentedWow! Nice traffic! : D
Let me know how that works - it's a hypothesis, not something I've tested. : )