1

I need to save some data in MySql which required to be retrieved super fast. Since there is a limit for the text amount which we can insert in MySql i break it into parts and add a sequence number to them. So when i fetch them i fetch them all and merge. Is this approach is faster than blob?

dinesh707
  • 12,106
  • 22
  • 84
  • 134

1 Answers1

0

If your MEDIUMTEXT/MEDIUMBLOB is compressible, then compress it in the client and store it into a MEDIUMBLOB. Ordinary text is 3x compressible. Most image formats are not compressible.

Why? By compressing in the client, you are transferring only 3MB, not 10MB to/from the server. Storing 3MB on disk is a lot faster than 10MB.

Compression will disallow FULLTEXT.

If you need to store more than 16MB, your chunking may be the 'right' solution -- for a variety of reasons we have not yet touched on.

Another approach is to store the 10MB in a file, then store the filename (or URL, or whatever) in the database in a VARCHAR. There are pros and cons to this; it is a common question.

Rick James
  • 135,179
  • 13
  • 127
  • 222