Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Adrian Klaver
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

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Melvin Davidson
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,

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Hans Guijt
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

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Melvin Davidson
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

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Melvin Davidson
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

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Melvin Davidson
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

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Tom Lane
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

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Marc Mamin
> 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 >

Re: [GENERAL] pg_relation_size performance issue

2015-06-04 Thread Hans Guijt
...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