Skip to main content
Inspiring
May 3, 2023
Question

VARCHAR vs BLOB

  • May 3, 2023
  • 3 replies
  • 0 views

Hi Experts,

Currently I'm working on an Enhancement Project where in the legacy Application we were using CLOB field to store comments.

Since CLOB is not available in MariaDb as a dataType what would be the recommended datatype to use in New System.
The max number of chars that we have for one of the such comment is 21499 chars.

What all will be the pros n cons of using VARCHAR(21499) vs BLOB datatype, and also if makes any impact on the performance of the record and UI using the comment table.

Thanks,

Gaurav Singh

3 replies

abhisheks0018
May 4, 2023

I would suggest to use LONGTEXT rather using VARCHAR or BLOB in this case

stefanhelzle0001
Brainy
May 4, 2023

VARCHAR is limited to 4000. And the overall index size for a row is limited to 16k. Use TEXT or LONGTEXT. The MariaDB documentation will guide you.

Be aware that synced Records are limited to 4k as of now. This cannot be changed.

Inspiring
May 4, 2023

Thanks for your response Stefan, Currently we are using varchar(1000) and requirement is to get that updated to 10,000 char

Also the we are using non-sync record for the comment search.

Thanks,

Gaurav Singh