Unanswered: calculate used disk space of single client
I am developing an application qith a pgsql database where I will store all my clients data in a single database. Each table will have a "client_id" to identify that the data is belonging to a single client. Now I wish to add a disk-quota, i.e. I should have a way to calculate the total size on disk of all records belonging to a single client. Is this possible in pgsql?
Well, it depends on the table definition, the indexes specified, etc. In addition, the database character encoding plays a large part. (2 byte character encoding takes apx. twice the space as ASCII encoding, for instance)
The documentation specifies the amount of space reserved for each data type.
Each index uses disk space, with the indexed field(s) sizes and a record pointer.
I'm sure that there are other calculations involved, but, offhand, I'm not sure what they are.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert