pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
autovacuum on updated rows
5+ messages / 4 participants
[nested] [flat]

* autovacuum on updated rows
@ 2005-11-11 20:10 Stephen Byers <stephenabyers@yahoo.com>
  2005-11-11 20:37 ` Re: autovacuum on updated rows Jaime Casanova <systemguards@gmail.com>
  2005-11-11 20:38 ` Re: autovacuum on updated rows Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 5+ messages in thread

From: Stephen Byers @ 2005-11-11 20:10 UTC (permalink / raw)
  To: pgsql-admin

I am using new postgres 8.1 and also trying out the integrated autovacuum.  I have a concern.
 
I have a table where I perform an update on a row every 10 seconds.  The table is VERY small.  Hardly any INSERTS, no DELETES, and a ton of UPDATES.
 
adbs_db=# select count(*) from volumes;
 count 
-------
     7
(1 row)

 

 

I am looking at the file sizes that correspond to this table and its indeces.  They are growing -- I think I understand why -- dead rows are occuring on an UPDATE.  But what I don't understand is why autovacuum has not kicked in-- I have kept the default values on autovacuum.

 

In about 50 minutes' time, the table itself has grown 2MB, and each index has grown by about 1MB
 
Will autovacuum eventually run on this table????  What rows/columns does autovacuum look at to determine when to work on a table?  I'd like to look at those rows, too.
 
Thanks!!
Steve
 
 
adbs_db=# \d volumes
                     Table "public.volumes"
      Column      |          Type          |     Modifiers      
------------------+------------------------+--------------------
 label            | character varying(128) | not null
 imported         | boolean                | not null
 closed           | boolean                | not null
 active           | boolean                | not null
 online           | boolean                | not null
 offline          | boolean                | not null
 archiver_name    | character varying(32)  | not null
 environment_name | character varying(32)  | not null
 curr_size        | bigint                 | not null default 0
 vol_num          | integer                | not null
 start_time       | integer                | 
 stop_time        | integer                | 
Indexes:
    "volumes_i1" unique, btree (label)
    "volumes_i2" btree (environment_name)


		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: autovacuum on updated rows
  2005-11-11 20:10 autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
@ 2005-11-11 20:37 ` Jaime Casanova <systemguards@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Jaime Casanova @ 2005-11-11 20:37 UTC (permalink / raw)
  To: Stephen Byers <stephenabyers@yahoo.com>; +Cc: pgsql-admin

On 11/11/05, Stephen Byers <stephenabyers@yahoo.com> wrote:
> I am using new postgres 8.1 and also trying out the integrated autovacuum.
> I have a concern.
>
> I have a table where I perform an update on a row every 10 seconds.  The
> table is VERY small.  Hardly any INSERTS, no DELETES, and a ton of UPDATES.
>
> adbs_db=# select count(*) from volumes;
>  count
> -------
>      7
> (1 row)
>
>
>
>
>
> I am looking at the file sizes that correspond to this table and its
> indeces.  They are growing -- I think I understand why -- dead rows are
> occuring on an UPDATE.  But what I don't understand is why autovacuum has
> not kicked in-- I have kept the default values on autovacuum.
>
>

i will assume you change #autovacuum=off for on in postgresql.conf you
have to activet stats_stat_collector and stats_row_level too...

here explains what factors are used for determining vacuum needs for
tables: http://www.postgresql.org/docs/8.1/static/maintenance.html#AUTOVACUUM


>
> In about 50 minutes' time, the table itself has grown 2MB, and each index
> has grown by about 1MB
>
> Will autovacuum eventually run on this table????  What rows/columns does
> autovacuum look at to determine when to work on a table?  I'd like to look
> at those rows, too.
>
> Thanks!!
> Steve
>
>
> adbs_db=# \d volumes
>                      Table "public.volumes"
>       Column      |          Type          |     Modifiers
> ------------------+------------------------+--------------------
>  label            | character varying(128) | not null
>  imported         | boolean                | not null
>  closed           | boolean                | not null
>  active           | boolean                | not null
>  online           | boolean                | not null
>  offline          | boolean                | not null
>  archiver_name    | character varying(32)  | not null
>  environment_name | character varying(32)  | not null
>  curr_size        | bigint                 | not null default 0
>  vol_num          | integer                | not null
>  start_time       | integer                |
>  stop_time        | integer                |
> Indexes:
>     "volumes_i1" unique, btree (label)
>     "volumes_i2" btree (environment_name)
>
>

--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: autovacuum on updated rows
  2005-11-11 20:10 autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
@ 2005-11-11 20:38 ` Tom Lane <tgl@sss.pgh.pa.us>
  2005-11-11 21:05   ` Re: autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2005-11-11 20:38 UTC (permalink / raw)
  To: Stephen Byers <stephenabyers@yahoo.com>; +Cc: pgsql-admin

Stephen Byers <stephenabyers@yahoo.com> writes:
> Will autovacuum eventually run on this table????

Um ... is autovacuum actually turned on?  (It's not by default.)

Check the pg_stat_ views to see if the updates are getting counted in
the statistics for the table.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: autovacuum on updated rows
  2005-11-11 20:10 autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
  2005-11-11 20:38 ` Re: autovacuum on updated rows Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-11-11 21:05   ` Stephen Byers <stephenabyers@yahoo.com>
  2005-11-13 19:05     ` Re: autovacuum on updated rows Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Stephen Byers @ 2005-11-11 21:05 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

Sorry for noise.  It turns out that little pound sign in front bit me !!
#autovacuum = on

Tom Lane <tgl@sss.pgh.pa.us> wrote:
Stephen Byers writes:
> Will autovacuum eventually run on this table????

Um ... is autovacuum actually turned on? (It's not by default.)

Check the pg_stat_ views to see if the updates are getting counted in
the statistics for the table.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: autovacuum on updated rows
  2005-11-11 20:10 autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
  2005-11-11 20:38 ` Re: autovacuum on updated rows Tom Lane <tgl@sss.pgh.pa.us>
  2005-11-11 21:05   ` Re: autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
@ 2005-11-13 19:05     ` Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2005-11-13 19:05 UTC (permalink / raw)
  To: Stephen Byers <stephenabyers@yahoo.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

Stephen Byers wrote:
> Sorry for noise.  It turns out that little pound sign in front bit me !!
> #autovacuum = on

So, does it work after you activate it?  Please note that there's a
threshold in the number of tuples that will need to be modified for
a vacuum operation to be launched.  For such a small table you may want
to lower the threshold a bit.  See the docs on the pg_autovacuum system
catalog, in the "internals" chapter.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-11-13 19:05 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-11 20:10 autovacuum on updated rows Stephen Byers <stephenabyers@yahoo.com>
2005-11-11 20:37 ` Jaime Casanova <systemguards@gmail.com>
2005-11-11 20:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-11-11 21:05   ` Stephen Byers <stephenabyers@yahoo.com>
2005-11-13 19:05     ` Alvaro Herrera <alvherre@commandprompt.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox