Re: Really really slow select count(*) - Mailing list pgsql-performance

From felix
Subject Re: Really really slow select count(*)
Date
Msg-id AANLkTimw2izMi4QfizQm72ABePackWXhhUU9EHdNf3zk@mail.gmail.com
Whole thread Raw
In response to Re: Really really slow select count(*)  (Shaun Thomas <sthomas@peak6.com>)
Responses Re: Really really slow select count(*)
Re: Really really slow select count(*)
List pgsql-performance
it probably has good reason to hate me.



ns=> SELECT n.nspname AS schema_name, c.relname AS table_name,
ns->       c.reltuples AS row_count,
ns->       c.relpages*8/1024 AS mb_used,
ns->       pg_total_relation_size(c.oid)/1024/1024 AS total_mb_used
ns->  FROM pg_class c
ns->  JOIN pg_namespace n ON (n.oid=c.relnamespace)
ns->  WHERE c.relkind = 'r'
ns->  ORDER BY total_mb_used DESC
ns->  LIMIT 20;
 schema_name |            table_name            |  row_count  | mb_used | total_mb_used 
-------------+----------------------------------+-------------+---------+---------------
 public      | django_session                   | 1.47843e+07 |    4122 |         18832
 public      | traffic_tracking2010             | 9.81985e+06 |     811 |          1653
 public      | mailer_mailingmessagelog         | 7.20214e+06 |     441 |          1082
 public      | auth_user                        | 3.20077e+06 |     572 |           791
 public      | fastadder_fastadderstatus        |      302479 |     458 |           693
 public      | registration_registrationprofile | 3.01345e+06 |     248 |           404
 public      | reporting_dp_6c93734c            |  1.1741e+06 |      82 |           224
 public      | peoplez_contact                  |       79759 |      18 |           221
 public      | traffic_tracking201101           | 1.49972e+06 |     163 |           204
 public      | reporting_dp_a3439e2a            | 1.32739e+06 |      82 |           187
 public      | nsproperties_apthistory          |       44906 |      69 |           126
 public      | nsproperties_apt                 |       30780 |      71 |           125
 public      | clients_showingrequest           |       85175 |      77 |           103
 public      | reporting_dp_4ffe04ad            |      330252 |      26 |            63
 public      | fastadder_fastadderstatuslog     |      377402 |      28 |            60
 public      | nsmailings_officememotoagent     |      268345 |      15 |            52
 public      | celery_taskmeta                  |        5041 |      12 |            32
 public      | mailer_messagelog                |      168298 |      24 |            32
 public      | datapoints_job                   |        9167 |      12 |            23
 public      | fastadder_fastadderstatus_errors |      146314 |       7 |            21

oh and there in the footnotes to django they say "dont' forget to run the delete expired sessions management every once in a while". thanks guys.

it won't run now because its too big, I can delete them from psql though

well just think how sprightly my website will run tomorrow once I fix these.




On Fri, Feb 4, 2011 at 9:00 PM, Shaun Thomas <sthomas@peak6.com> wrote:
On 02/04/2011 01:59 PM, felix wrote:


still no advice on the pages

I think it just hates you.


--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604
312-676-8870
sthomas@peak6.com

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

pgsql-performance by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: Really really slow select count(*)
Next
From: Shaun Thomas
Date:
Subject: Re: Really really slow select count(*)