Re: Unusual table size and very slow inserts

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Ivano Luberti <luberti(at)archicoop(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Unusual table size and very slow inserts
Date: 2010-02-03 08:07:56
Message-ID: 4B692EDC.2010001@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivano Luberti wrote:
> This is what I was thinking , but today I was able to look at the
> processes running while a client was doing a bunc of inserts. There was
> no autovacuum running and every insert was taking many seconds to e
> executed.
>

Have you done any basic tuning of the database parameters? From your
earlier message, it sounds like you might have checkpoint_segments at
its default, which can contribute to these inserts taking so long. See
http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server for a
guide to where to start.

Also, if you want to get a better idea what's actually going on with
your data, you should be looking at "select * from pg_stat_user_tables"
; that will give you information about things like how many dead rows
there are in the table, when autovacuum last did some work, etc. Should
be possible to figure out what's different about the use pattern of this
table compared to the ones you suggest work as expected by analyzing
that data.

P.S. To clean up from one of these messes you might try CLUSTER instead
of VACUUM FULL.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2010-02-03 08:30:32 Re: surprised by non-strict array_append
Previous Message Shoaib Mir 2010-02-03 07:44:14 Re: add column specify position