-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display correct effective size #19094
base: QA_5_2
Are you sure you want to change the base?
Conversation
Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## QA_5_2 #19094 +/- ##
============================================
- Coverage 48.61% 47.41% -1.21%
Complexity 17028 17028
============================================
Files 607 607
Lines 72365 72362 -3
============================================
- Hits 35182 34310 -872
- Misses 37183 38052 +869
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
$showtable['Data_length'] | ||
+ $showtable['Index_length'] | ||
- $showtable['Data_free'], | ||
$showtable['Data_length'] + $showtable['Index_length'] + $showtable['Data_free'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a 20+ years bug ?
Seems to have been added in 8448577#diff-83e3a89d98949a8b6e583e77d428adf8b1f0d8b54abba4afaa97728b5f7b8edbR275
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still can not find a conclusion using external sources.
See: https://tableplus.com/blog/2018/04/mysql-get-size-of-tables.html or https://www.a2hosting.com/kb/developer-corner/mysql/determining-the-size-of-mysql-databases-and-tables/
Do you have an idea on how to verify the new total is the right one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@williamdes not sure if is related or not, but I've encountered many times a strange issue like, the total size of a db or table had a different size after duplicating it from phpMyAdmin - (MyISAM engine).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The effective size should match the .ibd file size.
The .ibd file for this table is 10.764.288 KB
From #18771 (comment) roughly matches the sum of Overhead and Total (3.8 + 6.6) * 1024 * 1024
= 10,905,190.4 KB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@williamdes You could create a table and insert a lot of data. Repeatedly check that the effective size matches the file size on disk after deleting some of the data.
Fixes #18771
Total
is the space needed for index and data,Effective
is the file size on disk, which includes'Data_free'
, so it should be added instead of subtracted.