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

    Unanswered: calculate used disk space of single client

    Hello,

    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?

    Cheers
    Tom

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    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.
    Lou
    使大吃一惊
    "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
  •