Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: query is taking longer time after a while


  • From: "A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Re: query is taking longer time after a while
  • Date: Wed, 30 Sep 2009 08:48:42 +0200
  • Message-id: <20090930064842.GA5154@a-kretschmer.de> <text/plain>

In response to tomrevam :
> 
> 
> 
> Scott Marlowe-2 wrote:
> > 
> > Just wondering, what version of pgsql are you running?  I noticed a
> > lot less degradation from heavily updated tables when I went to 8.3
> > and set the fill % for tables / indexes to 90% or so.  If you're
> > running an older version, the upgrade to 8.3 may well be worth the
> > effort.
> > 
> 
> I'm using version 8.3, but I don't know what you meant by fill %.

Copy&Paste from the doc:
( http://www.postgresql.org/docs/8.4/interactive/sql-createtable.html )


The fillfactor for a table is a percentage between 10 and 100. 100
(complete packing) is the default. When a smaller fillfactor is
specified, INSERT operations pack table pages only to the indicated
percentage; the remaining space on each page is reserved for updating
rows on that page. This gives UPDATE a chance to place the updated copy
of a row on the same page as the original, which is more efficient than
placing it on a different page. For a table whose entries are never
updated, complete packing is the best choice, but in heavily updated
tables smaller fillfactors are appropriate.

You can set this with this command:

alter table foo set (fillfactor=90);


Regards, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group