On 06/04/2015 07:24 AM, Hans Guijt wrote:
Thanks, this is most helpful. I originally found that query somewhere on
the internet and used it as-is.
If I drop the restriction on table name I get a list that also includes
indexes, constraints, etc. Is there a way to restrict the returned set
to tab
2015 16:08
> *To:* Tom Lane
> *Cc:* Hans Guijt; pgsql-general@postgresql.org
> *Subject:* Re: [GENERAL] pg_relation_size performance issue
>
>
>
> Dammit pg_total_relation_size includes toast data. Thumb problems and to
> quick to hit send. :(
>
>
>
> On Thu, Jun 4,
Davidson [mailto:melvin6...@gmail.com]
Sent: 04 June 2015 16:08
To: Tom Lane
Cc: Hans Guijt; pgsql-general@postgresql.org
Subject: Re: [GENERAL] pg_relation_size performance issue
Dammit pg_total_relation_size includes toast data. Thumb problems and to quick
to hit send. :(
On Thu, Jun 4, 2015 at
Dammit pg_total_relation_size includes toast data. Thumb problems and to
quick to hit send. :(
On Thu, Jun 4, 2015 at 10:07 AM, Melvin Davidson
wrote:
> Correction, pg_relation_size includes toast data.
>
> On Thu, Jun 4, 2015 at 10:03 AM, Melvin Davidson
> wrote:
>
>> I'm not sure why you are
Correction, pg_relation_size includes toast data.
On Thu, Jun 4, 2015 at 10:03 AM, Melvin Davidson
wrote:
> I'm not sure why you are adding toast to table size, since
> pg_relation_size already does that.
>
> http://www.postgresql.org/docs/9.3/interactive/functions-admin.html
>
> This query migh
I'm not sure why you are adding toast to table size, since pg_relation_size
already does that.
http://www.postgresql.org/docs/9.3/interactive/functions-admin.html
This query might work better and faster for you.
SELECT n.nspname as schema,
c.relname as table,
a.rolname
Hans Guijt writes:
> I have a Postgres 9.3.7 database, freshly created on Ubuntu 14 LTS 64 bit,
> and at this time almost completely empty. I'm attempting to find the size of
> a table, using the following code:
> SELECT
> pg_relation_size (stat.relid),
> CASE WHEN cl.reltoastrelid = 0 THEN
> I have a Postgres 9.3.7 database, freshly created on Ubuntu 14 LTS 64 bit,
> and at this time almost completely empty. I'm attempting to find the size of
> a table, using the following code:
>
> SELECT
> pg_relation_size (stat.relid),
> CASE WHEN cl.reltoastrelid = 0 THEN
> 0
> ELSE
>
...and I forgot to add: for the rest the database is behaving fine; everything
else works without performance issues, even when we stepped up the amount of
data somewhat. It's just this one query that is somehow very slow.
Hans Guijt
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-ge