Обсуждение: pgsql-server: The current implementation of dbsize doesn't handle tables

Поиск
Список
Период
Сортировка

pgsql-server: The current implementation of dbsize doesn't handle tables

От
momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Log Message:
-----------
The current implementation of dbsize doesn't handle tables in
tablespaces correctly, and is quite restricted on objects covered (only
tables and databases, but not tablespaces and indexes).

The attached patch contributes:

- database_size(name)
- relation_size(text)
These are the well-known functions, tablespace-aware.

- pg_tablespace_size(oid)
- pg_database_size(oid)
- pg_relation_size(oid)
Tablespace-aware implementations, used by the upper functions.
pg_relation_size will report sizes of indexes as well.

- pg_size_pretty(bigint)
Formatting of sizes, to display '146MB' instead of '152885668'

Andreas Pflug

Modified Files:
--------------
    pgsql-server/contrib/dbsize:
        dbsize.c (r1.12 -> r1.13)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dbsize/dbsize.c.diff?r1=1.12&r2=1.13)
        dbsize.sql.in (r1.2 -> r1.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dbsize/dbsize.sql.in.diff?r1=1.2&r2=1.3)

Re: pgsql-server: The current implementation of dbsize doesn't handle tables

От
Alvaro Herrera
Дата:
On Wed, Sep 01, 2004 at 09:55:22PM -0300, Bruce Momjian wrote:

> The current implementation of dbsize doesn't handle tables in
> tablespaces correctly, and is quite restricted on objects covered (only
> tables and databases, but not tablespaces and indexes).

I agree this is a big patch, but is it correct to have the file carry an
author tag of Andreas Pflug?  What happened to all previous
contributors?  Why is the original author's name not even mentioned?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The problem with the future is that it keeps turning into the present"
(Hobbes)


Re: pgsql-server: The current implementation of dbsize

От
Bruce Momjian
Дата:
Removed.  I assume the line got in there just because the file
originally has _no_ header comment.  It wasn't a copyright line so I
assume it is fine just to remove it.

---------------------------------------------------------------------------

Alvaro Herrera wrote:
> On Wed, Sep 01, 2004 at 09:55:22PM -0300, Bruce Momjian wrote:
>
> > The current implementation of dbsize doesn't handle tables in
> > tablespaces correctly, and is quite restricted on objects covered (only
> > tables and databases, but not tablespaces and indexes).
>
> I agree this is a big patch, but is it correct to have the file carry an
> author tag of Andreas Pflug?  What happened to all previous
> contributors?  Why is the original author's name not even mentioned?
>
> --
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> "The problem with the future is that it keeps turning into the present"
> (Hobbes)
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073