Home Forums Backend Issues (wp-admin) Performance of Backend super slow Reply To: Performance of Backend super slow

  • @heytricia this is something that I did not realize, and did not look into.

    For both ACF repeaters and flex fields: ACF compares the number of rows in the old value with the number of rows in the new value. If the number of rows are different, ACF deletes the excess old rows.

    This however does not necessarily mean that stale data will be removed, especially for flex field. Let’s say that the layout of row 1 has changed. In the old layout there is a field names ‘field_x’ and this field does not exist in the new layout. The value for ‘field_x’ will remain in the database. Depending on how many different field names you use for different layouts and how many layouts you have the amount of leftover data could be significant. This issue can be alleviated by using the same sub field names as much as possible.

    There is also the case of conditional logic and this effects all fields, in a repeater/flex field or not. Fields hidden by conditional logic are not updated or removed if they were not hidden before and are hidden later. This data will always be left.

    As far as converting repeaters to flex fields, I would not. Repeaters and flex fields, internally, are stored 99.99% the same. Flex fields are repeater fields, the only differnce is that in a repeater, every row has the same field and for a flex field every row can have different fields. For me, repeaters and flex fields have 2 completely different uses. I would never create a flex field if I know that every row will have the same fields.

    Considering that ACF deletes excess rows, repeaters are safer as far as stale data is concerned.

    The difference between Repeaters and Flex fields. In the database a repeater holds an integer in the meta data for that field name that represents the number of rows in the repeater. For a flex field this meta value holds an array and each element in the array is the name of the layout for that row. It would be possible to convert one to the other, but I doubt it would be a simple process.