How to get the size of a record in MySql if the table contains fields of type TEXT or BLOB?
is it possible to get the size of a record or table using sql statement?
How can we determine the size of a given table in a given schema? SELECT table_name "Table Name", table_rows "Rows Count", round(((data_length + index_length)/1024/1024),2) "Table Size (MB)" FROM information_schema.
Determine the size, then the average number of occurrences of each segment type in a database record. By multiplying these two numbers together, you get the size of an average database record.
Row Size Limits. The maximum row size for a given table is determined by several factors: The internal representation of a MySQL table has a maximum row size limit of 65,535 bytes, even if the storage engine is capable of supporting larger rows.
To calculate the size of a string or blob in bytes, use LENGTH(YourColumn)
.
To calculate the number of characters in a text string, use CHAR_LENGTH(YourTextColumn)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With