Sample Header Ad - 728x90

Calculate row size and max row size for a table

22 votes
6 answers
81246 views
Is there any way of calculating the number of bytes occupied by the table? I know that you can get some information from information_schema.tables but that information is not accurate enough. What actually required is the number of bytes according to the definition of the table for **InnoDB only** and collation could also be considered as **utf-8-general-ci**. For example, a table test is as following
create table test   (
   col1 varchar(25),
   col2 int,
   col3 varchar(3),
   col4 char(15),
   col5 datetime    
);
I would require to know the total row size that can be accumulated in one row, according to the types of columns in the table. Found a some sort of similar solution for MS SQL Server, but need its MySQL version
Asked by Nawaz Sohail (1480 rep)
Sep 8, 2015, 02:50 PM
Last activity: Nov 7, 2022, 04:32 PM