MySQL Forums
Forum List  »  General

MySQL storage allocation
Posted by: S.M. Gopinath
Date: October 10, 2024 07:43AM

I'm a newbie, I'm trying to study the mysql storage allocation when a new table is created in MySQL. I'm using mysql 8.0.35 community edition.

For the learning purpose, I created a new table t1 with one column - c1 int data type. This table has only one row - 1.

I used stat command to understand the allocation, but I can't understand how space is allocated for table files.


[mysql1@pgsql1 test1]$ stat t1.ibd
File: ‘t1.ibd’
Size: 114688 Blocks: 224 IO Block: 4096 regular file
Device: fd02h/64770d Inode: 1200 Links: 1
Access: (0640/-rw-r-----) Uid: ( 1003/ mysql1) Gid: ( 27/ mysql)
Access: 2024-10-10 09:43:23.992888041 +0530
Modify: 2024-10-10 09:43:46.646284448 +0530
Change: 2024-10-10 09:43:46.646284448 +0530
Birth: -


My OS - RHEL 7
OS block size - 4096

But in the stat output says 224 blocks allocated, so file size should be 896 KB but its only 112 KB. Someone please help me to understand this.

Options: ReplyQuote


Subject
Written By
Posted
MySQL storage allocation
October 10, 2024 07:43AM
October 10, 2024 08:03PM
October 14, 2024 11:44PM
October 15, 2024 12:56AM
October 15, 2024 08:52AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.