I am updating a row in MySQL which currently has 15 varchar(2500) columns plus a few other small sized columns. I need to allow the user to enter more data in these columns, would it be better to convert them to BLOBS? Is there a maximum recommended number of BLOBS per row?
What is best practice with regards to not exceeding the maximum number of bytes per row whilst still allowing the user flexibility with regards to how much they enter in each column?
Many thanks.
No, there’s no maximum recommended number of BLOBS on a row. You are really only limited by the maximum size of the row. There is some performance overhead for accessing each BLOB (the row contains a pointer to the BLOB data which is stored elsewhere, vs. accessing a column value actually stored within the row.)
The best practice is to include the most frequently accessed columns within the row, and limit the size of variable length columns to practical limits. Consider TEXT and/or BLOB columns when the size of the column exceeds the maximum allowed by other datatypes, or when the length of the row exceeds the maximum allowed. Alternatively, consider separate child table(s) for less frequently accessed “long-ish” columns.