What is the limitation on the number of fields you can add to a module?

Is there a limitation on the number of fields you can add to a module? Or is the limitation based on the size of the field?

Parents
  • Sugar itself doesn't impose a limit, but there is a limit that would be imposed by your database server.

    That number will vary not only based on the type of database server you choose, but also the general definition of the columns that are already defined for a given table. It is also possible to manipulate the database server configuration so as to manipulate said limits.

    For example, if memory serves me, Microsoft SQL Server has a limit of 1024 columns per table. MySQL claims 4096. In either case, the effective limit will vary based on the definition of the columns as there is a page size limit as well (or record size limit), which also varies. I believe it is 4K for MS-SQL and 8 K for MySQL. Meaning, you can't create 1024 or 4096 text columns all of which are 255 characters long (the max size) because, combined, those columns would exceed the allowed page size.

    This is why we often spend a lot of time examining the best design for a given database/Sugar instance, as creating a multitude of custom fields not only runs the risk of encountering one of these limits, but also has implications on performance. Often times, using a related module is better than using a custom field.

    Anyway, that's the annotated version of the explanation, but hopefully it helps you.

Reply
  • Sugar itself doesn't impose a limit, but there is a limit that would be imposed by your database server.

    That number will vary not only based on the type of database server you choose, but also the general definition of the columns that are already defined for a given table. It is also possible to manipulate the database server configuration so as to manipulate said limits.

    For example, if memory serves me, Microsoft SQL Server has a limit of 1024 columns per table. MySQL claims 4096. In either case, the effective limit will vary based on the definition of the columns as there is a page size limit as well (or record size limit), which also varies. I believe it is 4K for MS-SQL and 8 K for MySQL. Meaning, you can't create 1024 or 4096 text columns all of which are 255 characters long (the max size) because, combined, those columns would exceed the allowed page size.

    This is why we often spend a lot of time examining the best design for a given database/Sugar instance, as creating a multitude of custom fields not only runs the risk of encountering one of these limits, but also has implications on performance. Often times, using a related module is better than using a custom field.

    Anyway, that's the annotated version of the explanation, but hopefully it helps you.

Children