Open gorisken opened 5 days ago
Thank you, could you please specify in which version you have encoutered this issue? Just to rule out it is affected by https://github.com/pimcore/pimcore/pull/16482
I checked the version and I'm running now on 11.1.5
Pimcore version
All
Steps to reproduce
Create 2 new data classes, for example order and orderline. In the order class add a Advanced One-to-Many Object relation field with the name lines, relate it to the orderline class and add multiple metadata fields (10 integers or strings for example). If you generate now 1000 order objects width multiple related orderlines without filling the metadata field. you will see that for each field there is a new record in the object_metadata table. This results in a huge amount of records in the table and blows up the database size because of the index on the table.
Actual Behavior
Each metadata field in an advanced relation gets a separate record, even if there is a null value. If I delete the null records from the table with a script. Everything remains working as expected, but the table size reduces with 20 to 80% depending on the fields with an actual value.
Expected Behavior
Create the separate record only if there is an actual value set in the field.