Hi,
(10-11-2008 02:20 AM)sci2tech Wrote: The idea is good but the the result is not accurate. This method does not add size of .frm (than contain structure of table or output from a Create view commands) file witch usually is ~8k for each table in first case.
In fact, the method
mysqldb_quota_by_dir_engine doesn't count the .frm files either. The differences are only caused by the db.opt file and the directory itself.
If you run this command:
Code:
du -csb --exclude=*.frm --exclude=db.opt /var/lib/mysql/DATABASE/* | tail -1
the calculated space will be the same as the output of the method
mysqldb_quota_by_mysql_engine, which can be simulated on a shell like this:
Code:
echo "SHOW TABLE STATUS;" | mysql DATABASE | awk '{ sum += $7 + $9 } END { print sum }'
So I'd suppose to instead modify
mysqldb_quota_by_dir_engine so that it ignores the size of db.opt and the directory by using the du - command shown above. In my opinion this is the right solution since the user doesn't really uses the size of db.opt and the directory itself with it's mysql db - so it would be correct to not count it.
I've just apploaded a third (
) patch, which makes (besides the other changes) the two methods counting the same, as I've described above...
Regards
FeG