X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 30B3A52851 for ; Tue, 7 Jun 2005 19:21:51 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85798-04 for ; Tue, 7 Jun 2005 22:21:46 +0000 (GMT) Received: from cmailg3.svr.pol.co.uk (cmailg3.svr.pol.co.uk [195.92.195.173]) by svr1.postgresql.org (Postfix) with ESMTP id 8E8B852800 for ; Tue, 7 Jun 2005 19:21:46 -0300 (ADT) Received: from modem-2650.leopard.dialup.pol.co.uk ([217.135.154.90] helo=192.168.0.102) by cmailg3.svr.pol.co.uk with esmtp (Exim 4.41) id 1DfmSC-000806-IR; Tue, 07 Jun 2005 23:21:48 +0100 Subject: Re: slow growing table From: Simon Riggs To: Jone C Cc: pgsql-performance@postgresql.org In-Reply-To: <6556952605060609485c622403@mail.gmail.com> References: <6556952605060609485c622403@mail.gmail.com> Content-Type: text/plain Organization: 2nd Quadrant Date: Tue, 07 Jun 2005 23:21:48 +0100 Message-Id: <1118182908.3844.1605.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.054 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/153 X-Sequence-Number: 12790 On Mon, 2005-06-06 at 09:48 -0700, Jone C wrote: > HI! > > I have a table that I use for about a month. As the month progresses, > COPYs performed to this table get much much slower than they were at > the beginning, for the same number of rows (about 100,000 and > growing). > > I'm essentially doing a delete for a given day, then a COPY as a big > transaction. This is done about 12 times a day. > > When the table is new it's very fast, towards the end of the month > it's taking almost 10 times longer, yet I'm deleting and COPYing in > the same amount of data. Other operations on this table slow down, > too, that were fast before using the same criteria. > > I do a VACUUM ANALYZE after each delete / COPY process, I tried > experimenting with CLUSTER but saw no real difference. > > this is psql 7.45 on Linux server, dedicated for this purpose. About 5 > indexes, no FKs on this table. > > happy to provide any other info might need, suggestions appreciated > Search the archives for details within 4 months of a similar issue. The consensus was that this was because the indexes had become too big to fit in memory, hence the leap in response times. The workaround is to split the table into smaller pieces. Best Regards, Simon Riggs