[HACKERS] Dbsize backend integration

2005-06-28 Thread Dave Page
The attached patch integrates dbsize functions into the backend, as per discussion on -hackers. The following functions are included: pg_relation_size(text) - Get relation size by name/schema.name pg_relation_size(oid)- Get relation size by OID pg_tablespace_size(name) - Get tablespace size

Re: [HACKERS] DBSize backend integration

2005-06-26 Thread Tom Lane
Bruce Momjian writes: > Can someone come up with a better name than total_relation_size(), > because we already have relation_size()? The problem is that in the > first case, relation means the relation/indexes/toast, and in the second > it is just the heap. Should we call relation_size() pg_hea

Re: [HACKERS] DBSize backend integration

2005-06-26 Thread Bruce Momjian
Michael Paesold wrote: > > relation_size_components() depends on total_relation_size() (which I > > have to agree could be useful). I think relation_size_components() is > > unecessary though - it looks like it was designed to show a summary > > rather than as a view to be used by other clients (if

Re: [HACKERS] DBSize backend integration

2005-06-26 Thread Michael Paesold
Dave Page wrote: > -Original Message- > From: Andrew Dunstan [mailto:[EMAIL PROTECTED] > Sent: 24 June 2005 21:12 > To: Bruce Momjian > Cc: Dave Page; PostgreSQL-development > Subject: Re: [HACKERS] DBSize backend integration > > Bruce Momjian wrote: > > &g

Re: [HACKERS] DBSize backend integration

2005-06-25 Thread Bruce Momjian
Andreas Pflug wrote: > > > > > > > [from memory] the relation_components function adds components in a > questionable way, e.g. counting on index on the toast table as index. To > me, that's internal implementation detail, and should be counted as > toast table size too. Agreed. The user doe

Re: [HACKERS] DBSize backend integration

2005-06-25 Thread Andreas Pflug
Dave Page wrote: -Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Sent: 24 June 2005 21:07 To: Dave Page Cc: PostgreSQL-development Subject: Re: [HACKERS] DBSize backend integration So drop total_relation_size(), relation_size_components(), and

Re: [HACKERS] DBSize backend integration

2005-06-24 Thread Dave Page
> -Original Message- > From: Andrew Dunstan [mailto:[EMAIL PROTECTED] > Sent: 24 June 2005 21:12 > To: Bruce Momjian > Cc: Dave Page; PostgreSQL-development > Subject: Re: [HACKERS] DBSize backend integration > > > > Bruce Momjian wrote: > &

Re: [HACKERS] DBSize backend integration

2005-06-24 Thread Dave Page
> -Original Message- > From: Bruce Momjian [mailto:[EMAIL PROTECTED] > Sent: 24 June 2005 21:07 > To: Dave Page > Cc: PostgreSQL-development > Subject: Re: [HACKERS] DBSize backend integration > > > > > > > So drop total_relation_size(),

Re: [HACKERS] DBSize backend integration

2005-06-24 Thread Andrew Dunstan
Bruce Momjian wrote: So drop total_relation_size(), relation_size_components(), and what else? But these answer easily the question I see most asked - how much space in total does the relation occupy. I'd like to see at least one of these, properly named and fixed w.r.t. schemas. Getti

Re: [HACKERS] DBSize backend integration

2005-06-24 Thread Bruce Momjian
Dave Page wrote: > > > > -Original Message- > > From: Bruce Momjian [mailto:[EMAIL PROTECTED] > > Sent: 24 June 2005 20:45 > > To: Dave Page > > Cc: PostgreSQL-development > > Subject: Re: [HACKERS] DBSize backend integration > >

Re: [HACKERS] DBSize backend integration

2005-06-24 Thread Dave Page
> -Original Message- > From: Bruce Momjian [mailto:[EMAIL PROTECTED] > Sent: 24 June 2005 20:45 > To: Dave Page > Cc: PostgreSQL-development > Subject: Re: [HACKERS] DBSize backend integration > > > My personal view is that pg_database_size, pg_relation_size

Re: [HACKERS] DBSize backend integration

2005-06-24 Thread Bruce Momjian
Dave Page wrote: > The following functions are currently in contrib/dbsize. As Bruce has > suggested, we should discuss which functions should or shouldn't be > moved into the backend, and which should be renamed. > > int8 pg_database_size(oid) > int8 database_size(name) > > Both return the datab

[HACKERS] DBSize backend integration

2005-06-24 Thread Dave Page
The following functions are currently in contrib/dbsize. As Bruce has suggested, we should discuss which functions should or shouldn't be moved into the backend, and which should be renamed. int8 pg_database_size(oid) int8 database_size(name) Both return the database size in bytes, the first by o