Maximum Number of Elements

jbyrley

Member
Hi,

Newbie here... is there a maximum number of elements that may be used with Fabrikar? I've got over 700 fields that I need to set up. I've managed to import about 200 so far into the elements table, but after that I'm getting db errors saying the row size is too large. If there is a max that can fit into the elements table, is there a workaround, like creating a secondary elements table that Fabrikar can use?
 
The limitation isn't within Fabrik or our elements table, it's a built in limitation of 65535 byte "row size" on tables in MySQL. Each column has a size. So a VARCHAR(255) is 255 bytes, or 765 if your database is UTF-8 (where each character is 3 bytes). An INTEGER is 4 bytes. Etc. And that combined size cannot exceed 65535 bytes (64kb).

So the data tables you create within Fabrik have MySQL imposed limitations on how many columns of what size they can have. By default, we create our simple 'field' elements as VARCHAR(255). So the maximum would be 257 (well, minus a little for the PK 'id' element), or 85 if you are using UTF-8 encoding. To squeeze 700 simple VARCHAR columns in, the average size would have to be about 93 characters (or 31 if UTF-8).

You can reduce the size of field elements, by specifying the length ("Max Length" in the Advanced tab). We'll then change the VARCHAR size of the underlying column. What size you can set it to obviously depends on your data.

Or you could probably manually change those columns in the underlying table to "TEXT" instead of VARCHAR, as those don't take up space the way VARCHAR does, although that could impose other performance and functionality issues. TEXT data is stored "off table", whereby the data in the actual table row within the database is a pointer to another area of storage, so the database engine has to make an extra file system call for each TEXT column it is loading.

HOWEVER ... even if you manage to create a MySQL table with 700 columns, it's going to be extremely slow to actually use in Fabrik. I can't give hard metrics, as it depends entirely on what mix of element types you have, and whether you can exclude a lot of the elements from the list querying, etc. But typically we recommend keeping the number of elements under 100. We have some clients who have pushed that into the 200s, or even 300 or more. But I doubt very much 700 is a workable number.

-- hugh
 
Last edited:
Thank you for the rapid response. I guess you can really have as many elements saved in Fabrikar as you want, as long as you limit the number of elements per table. So, maybe you can split up a form into many different tables, and that way be able to have as many fields as you want in a form.
 
Yes, I think you could split it into multiple tables, and combine into one list/form with one-to-one list joins.

However, I still think it's going to cause problems, and that 700 is just too many elements for a single Fabrik list/form.

-- hugh
 
Ok, thanks. I will play around with it. Many of these fields are check boxes, others can be consolidated with others. Hopefully it will turn out to be a usable form.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top