Re: [HACKERS] Dbsize backend integration

From: Dawid Kuroczko <qnex42(at)gmail(dot)com>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Dbsize backend integration
Date: 2005-07-03 09:26:12
Message-ID: 758d5e7f05070302264fe6e703@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On 7/3/05, Andreas Pflug <pgadmin(at)pse-consulting(dot)de> wrote:
> > Yup, attached. Per our earlier conversation, pg_dbfile_size() now
> > returns the size of a table or index, and pg_relation_size() returns the
> > total size of a relation and all associated indexes and toast tables
> > etc.
>
> pg_relation_size's name is quite unfortunate, since the 8.0 contrib
> function does something different. And pg_dbfile_size sounds misleading,
> suggesting it takes a filename or relfilenode as parameter.

Oh, I think pg_dbfile_size is best so far. Assuming someone gives it a
filename, she'll get an error message. So practically it cannot be used
wrong by mistake. It is not so with other names proposed for that
function. Their names suggest they'll happily accept table/index/whatever
and return some size... But what size, that is the question. At least
pg_dbfile_size states that clearly. :)

As for pg_relation_size. I think its good enough, or at least I don't know
any better. I think it is better than pg_table_size, since people tend to
have personalized ideas what a table size is (a table with TOAST and
TOAST's indexes; a table with PRIMARY KEY,UNIQUE constraint indexes,
a table with all indexes involved,. etc/). pg_relation_size seems. at least
to me, to imply that its greedy and will take not only the table, and also
things the table is closely related to, like all the indexes.

The fun will begin when we'll have full working table partitioning and
multitable
indexes. ;))))

Regards,
Dawid

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Russell Smith 2005-07-03 11:21:56 Re: Checkpoint cost, looks like it is WAL/CRC
Previous Message Andreas Pflug 2005-07-03 07:46:48 Re: [HACKERS] Dbsize backend integration

Browse pgsql-patches by date

  From Date Subject
Next Message Marko Kreen 2005-07-03 13:06:27 Re: contrib/pgcrypto patch for OpenSSL 0.9.8
Previous Message Andreas Pflug 2005-07-03 07:46:48 Re: [HACKERS] Dbsize backend integration