Re: Really really slow select count(*)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx

______________________________________________

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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux