dsm13698679318 2018-04-20 14:16
浏览 282

如何计算每个MariaDB表行中的实际数据大小?

Is there any techniques to calculate actual used data size per every SQL table row? Including enabled Indexes and Log records? Sum of field sizes would not be correct because some fields can be empty or data is less than field size. Target is to know, how much exactly data is used per user. Probably I can do this in handler side.

  • 写回答

1条回答 默认 最新

  • dpsx99068 2018-05-10 01:34
    关注

    With the word "exactly", I have to say "no".

    Change that to "approximately", and I say

    SHOW TABLE STATUS
    

    and look at Avg_row_length. This info is also available in information_schema.TABLES.

    But, that is just an average. And not a very accurate average at that.

    Do you care about a hundred bytes here or there? Do users own rows in a single table? What the heck is going on?

    There are some crude formulas for computing the size of Data rows and Index rows, but nothing on Log records. One of the problems is that if there is a "block split" in a BTree because someone else inserted a row, do you divvy up the new block evenly across all users? Or what?

    评论

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)