
I have a custom post type with ACF fields that will be populated with an import from a .csv file. A large number of fields were supplied as yes/no (true/false) fields. There are approximately 30 fields that were supplied in the .csv file. For example, assume this data was supplied for a single custom post type:
Red: yes
Blue: no
Yellow: yes
Green: no
Orange: yes
Purple: yes
Black: no
White: no
Aqua: no
Pink: no
Gray: yes
etc….
Question – From a performance aspect, would it be better to convert these fields to a checkbox type instead of using true/false fields? The data will be output using a WP Template file (with the GeneratePress theme).
If there is a performance boost from using a Checkbox instead of a True/False field, I can pre-process the .csv file prior to the import to convert the data to a string instead of yes/no.
That is the data snippet above would be changed to a single field of ‘Colors’ and imported into an ACF Checkbox with the individual colors as the choices. The corresponding .csv for the colors above would be converted to:
Colors: ‘Red,Yellow,Orange,Purple,Gray’
My assumption is making a query for a single checkbox type would be faster than a query for 30 individual true/false fields.
thanks, -s