Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009

    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?


  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts