0

I have found similar question How to Get True Size of MySQL Database? except question looks at working out a full size of DB..

I am was wondering how can we workout the size of entries that belong to a particular user.

I have users table and a table for their records that they store, also there is another table that stored documents in blob.. so I would want to select all tables with user ID = x and than workout the size of data.. is this possible?

At the moment I am thinking give each entry approximate size i.e. 1MB and if they have 100 entries than user have used 100MB of data.

Community
  • 1
  • 1
Vlad Vladimir Hercules
  • 1,781
  • 2
  • 20
  • 37

1 Answers1

0

There's a OCTET_LENGTH function that tells you the size of the blob, like so:

SELECT OCTET_LENGTH(content) FROM Posts WHERE userId = 1;

Daniel Protopopov
  • 6,778
  • 3
  • 23
  • 39