Skip Navigation

[Resolved] Many field and performance/size DB

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2540041

Hi,
I am considering using toolset to create some CPTs with many fields. One of these custom post type must contain several information (e.g. first name, last name, address) and some of these fields will also be included in repeatable groups.

I wanted to understand this:
- Can the repeatable groups be limited? (example I have first name, last name, etc. and of this group I would like there can be maximum two "records");
- at the DB level does having many repeatable fields/groups affect weight and performance? I am assuming to enter about 50/100 records year of my custom post type.
- this data will be user editable in a restricted area (I bring this back to complete the information).
- when I delete a record of my custom post type all data at the DB level is deleted (I ask for confirmation).

Regards

#2540399

Hi,

Thank you for contacting us and I'd be happy to assist.

> Can the repeatable groups be limited? (example I have first name, last name, etc. and of this group I would like there can be maximum two "records");

- Repeatable field groups don't have any built-in option to restrict or limit them to a certain number.

But, if you create a one-to-many relationship between two post types, for example, 'Listings' -> 'Listing Records', you can set how many 'Listing Records' posts can be attached to a single 'Listing' posts. The actual custom fields like first name, last name, etc will be stored with the related 'Listing Records' post type, in this case.

> at the DB level does having many repeatable fields/groups affect weight and performance? I am assuming to enter about 50/100 records year of my custom post type.

- Whether you use a "repeatable field group" or regular 'one-to-many' post-relationship at the database level the structure to save them is the same.

Any custom fields that are inside a 'repeatable field group' are not stored with the actual post type, directly. A hidden custom post type is registered for each defined 'repeatable field group' and those custom fields are stored with that post type. And this post type is connected to the actual/parent post type through a hidden 'one-to-many' post-relationship too.

So in terms of performance, whether you use a 'repeatable field group' or a separate custom post type (linked through post-relationship) to store multiple records, it shouldn't make any difference.

> this data will be user editable in a restricted area (I bring this back to complete the information).

- Yes, you can use the post edit form to edit these records, regardless, of whether you choose the 'repeatable field group' or a separate custom post type approach.

> when I delete a record of my custom post type all data at the DB level is deleted (I ask for confirmation).

- When the actual/parent custom post type will be will be deleted, the data/custom fields stored with the connected/related post types will not be deleted automatically.
( again this is true for both approaches )

To achieve this, you'll need to include some custom code, that would execute whenever a post from the actual/parent post type is deleted, it deletes the data from the connected/related posts too.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2540627

My issue is resolved now. Thank you!