Received: from dmz2.unibox.ptinovacao.pt (unibox.ptinovacao.pt [194.65.138.76]) by postgresql.org (Postfix) with ESMTP id 9E74C475893 for ; Tue, 30 Jul 2002 16:51:21 -0400 (EDT) Received: from uniboxow.ptinovacao.pt ([10.80.50.202]) by dmz2.unibox.ptinovacao.pt (8.9.3/8.9.3) with SMTP id VAA04793 for ; Tue, 30 Jul 2002 21:21:27 +0100 Received: (qmail 14486 invoked by uid 0); 30 Jul 2002 20:46:25 -0000 Received: from unknown (HELO sargao) ([unknown]) (envelope-sender ) by unknown (qmail-ldap-1.03) with SMTP for ; 30 Jul 2002 20:46:25 -0000 Subject: Re: Postgres performance slowly gets worse over a month From: Marcos Garcia To: pgsql-admin In-Reply-To: <1027556279.17709.48.camel@sargao> References: <1027556279.17709.48.camel@sargao> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ejkkihnvVCYtBEfDSZ4F" X-Mailer: Ximian Evolution 1.0.8 Date: 30 Jul 2002 20:49:59 +0100 Message-Id: <1028058599.21225.86.camel@sargao> Mime-Version: 1.0 X-Archive-Number: 200207/415 X-Sequence-Number: 5099 --=-ejkkihnvVCYtBEfDSZ4F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable My apologies, to all that told me that the reindex was the solution to prevent the grouth of the database. I had a script that i thought that would reindex my database, but wasn't true. I figure out ,that the grouth of my database was due to the indexes with the following sql command: dbname=3D# select relname, relpages,reltuples from pg_class order by relpages desc limit 50; relname | relpages | reltuples=20 ---------------------------------+----------+----------- sms_recv_unique_idclimsgidclien | 55800 | 39259 sms_recv_pkey | 39810 | 38948 sms_send_pkey | 22828 | 52048 The relpages * 8 Kbytes, gives =3D~ the disk space used by the index/table (correct me if i'm wrong). As we can see from the query result the disk space used by the indexes is very high. After doing the reindex of the tables, that values droped down, as well as the space used by the database. Query result after reindex: dbname=3D# select relname, relpages,reltuples from pg_class order by relpages desc limit 50; relname | relpages | reltuples=20 ---------------------------------+----------+----------- sms_recv_unique_idclimsgidclien | 222 | 40581 sms_recv_pkey | 174 | 40581 sms_send_pkey | 430 | 54004 As a conclusion, in databases with high turn-around the use of reindex is imperative, combined with vacuums. Thanks to all, M.P.Garcia --------------------------------------------------------------------- Do not forget to reindex the db after the delete, index's do not manage them selves(if I remember correctly). The index will continue to grow until it eats your file system, as it did with me. By Marc Spitzer --------------------------------------------------------------------- On Thu, 2002-07-25 at 01:17, Marcos Garcia wrote: > Since this conversation had started, the presented solutions for the > disk space (disk space of tables and indexes) problem were: >=20 > - reindex -> no space recovered >=20 > - frequent vacuums -> some space recovered, meanwhile the database > keeps growing >=20 > - vacuumm full -> some space recovered, meanwhile the database keeps > growing, quite similar to simple vacuum. we have also to keep in mind, > that the option "full", makes locks to the tables. Therefore, the > services around the database locks too, and with the growing of the > database the time spent for "vacumm full" increases, as well as the > downtime of the services around the database. >=20 >=20 > So, my doubts are: >=20 > - There's nothing we can do to avoid the growth of the database, only > slow down that growth. >=20=20 > - We, application developers that use postgresql databases have to > count with this problem. >=20 > Sorry if i'm being a little rude, but i'm in a real trouble. >=20 > Thanks in advance, >=20 >=20 > M.P.Garcia > ` > end --=20 M.P.Garcia PT Inova=E7=E3o, SA Servi=E7os e Redes M=F3veis=20 Rua Jos=E9 Ferreira Pinto Basto - 3810 Aveiro Tel: 234 403 253 - Fax: 234 424 160 E-mail: marcos-p-garcia@ptinovacao.pt --=-ejkkihnvVCYtBEfDSZ4F Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQA9Ru3mGRIrLqlAVg0RAoi8AJ9azj4sPEmmwhZLmCMVXBg4hlnH1QCffzXu o393rAjTB6imopg28Yj/tRY= =0OuJ -----END PGP SIGNATURE----- --=-ejkkihnvVCYtBEfDSZ4F--