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

pawel_r created an issue. See original summary.

rszrama’s picture

Status: Active » Closed (fixed)

It'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.

pawel_r’s picture

Thank 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.

rszrama’s picture

Wow! Nice traffic! : D

Let me know how that works - it's a hypothesis, not something I've tested. : )