database - In MySQL, does the designated size of TEXT or BLOB affect performance or table size? -
i have table of data consists of foreign_key fields , blob column, other tables need not retrieve large blobs on regular basis.
so data-blob on own, matter length is? example, if want store cached webpages...for pages, 65kb limitation of blob it...but inevitably, there pages 100kb of data, next size of blob, mediumblob, 16mb:
http://dev.mysql.com/doc/refman/5.0/en/blob.html
how changing datablob field blob mediumblob affect kind of retrieval operations, whether it's several records @ row or large batch operations? don't mean, "how retrieving records of 16mb in size different records of 64kb?"...i mean ask, there difference if blob sparsely populated? is, 90% of fields have 60k of data, , rest may past 65k limit.
another way ask this: if data i'm working may consist of 50% blobs of blob size, , 50% of mediumblob...should create 2 tables , separate data way? or of little difference making 1 mediumblob table , storing small blobs in there? (which simplify database access code)
the difference between blob , mediumblob encodes length in 2 bytes or 3 bytes. otherwise, stores length of content stored on given row.
so should declare column mediumblob.
some client database access libraries (e.g. php) preallocate buffer hold greatest length column might return, because can't tell before fetching whether it's 65k or 100k or 16mb. have found php example blows if try fetch longblob, because preallocates 4gb buffer, greater php max memory limit.
Comments
Post a Comment