Skip to content
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

Open
wants to merge 1 commit into
base: QA_5_2
Choose a base branch
from

Conversation

M393
Copy link
Contributor

@M393 M393 commented Apr 3, 2024

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.

Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 47.41%. Comparing base (ec2d9ba) to head (95c6198).
Report is 26 commits behind head on QA_5_2.

Files Patch % Lines
.../classes/Controllers/Table/StructureController.php 0.00% 2 Missing ⚠️
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     
Flag Coverage Δ
dbase-extension 48.14% <0.00%> (+<0.01%) ⬆️
recode-extension 48.11% <0.00%> (-0.56%) ⬇️
unit-7.2-ubuntu-latest 48.12% <0.00%> (+0.02%) ⬆️
unit-7.3-ubuntu-latest 48.54% <0.00%> (-0.01%) ⬇️
unit-7.4-ubuntu-latest 48.55% <0.00%> (+0.06%) ⬆️
unit-8.0-ubuntu-latest 48.59% <0.00%> (-0.05%) ⬇️
unit-8.1-ubuntu-latest 48.60% <0.00%> (-1.24%) ⬇️
unit-8.2-ubuntu-latest 48.58% <0.00%> (+0.03%) ⬆️
unit-8.3-ubuntu-latest 48.51% <0.00%> (-1.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

$showtable['Data_length']
+ $showtable['Index_length']
- $showtable['Data_free'],
$showtable['Data_length'] + $showtable['Index_length'] + $showtable['Data_free'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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 ?

Copy link
Contributor

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).

Copy link
Contributor

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

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants