Managing 'Row Size Too Large' Error for Optimized Empress Use

Introduction

In your journey with Empress, you might face an error message stating:

Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs.

This guide will help you understand this error, its cause, and provide practical solutions to solve it.

Interpreting the Error Message

This error message is displayed when you’ve exceeded the maximum number of fields that can be included in a form or document type within Empress.

Empress uses MySQL as its database management system, which allows up to 4096 columns per table. However, this limit can be lowered due to other factors. For instance, each table has a maximum row size of 65,535 bytes, and certain storage engine constraints can further decrease this limit.

The maximum row size impacts the number and size of columns you can create. This is because the total length of all columns cannot exceed 65,535 bytes. For example, if you’re using characters that require up to 3 bytes per character for a column with a maximum length of 140 characters, the server must allocate 420 bytes per value. This implies that a table cannot contain more than 156 such columns.

In Empress, columns of type VARCHAR(140) are created for field types like “Data”, “Link”, “Select”, “Dynamic Link”, “Password”, and “Read Only”. Therefore, you can create around 156 such fields in the system.

How to Resolve the Issue

If you need to add more fields to your system, consider these solutions:

  1. Change Field Types: Consider changing some of your fields to “Text”, “Small Text”, “Text Editor” or “Code” type. In MySQL, BLOB and TEXT columns only count as 1-4 plus 8 bytes each towards the row-size limit because their content is stored separately from the rest of the row. Changing to these field types will free up some space, allowing you to add more fields.

  2. Shorten Field Length: When creating fields, set a smaller value in the “Length” property. The system sets the length of the column based on this property and allocates size accordingly. Therefore, a smaller length will enable you to add more fields to your system.

Understanding and implementing these solutions will help you effectively manage the “Row Size Too Large” error and optimize your Empress system for your business needs. This not only resolves your current issue but also enhances your overall process, making it easier to add and manage fields in your Empress system.

For further assistance or more resources, feel free to reach out to our support team or explore our user-friendly guides and guides.