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 4FDC1D1B360 for ; Wed, 7 Jul 2004 16:19:25 -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 85025-03 for ; Wed, 7 Jul 2004 19:19:23 +0000 (GMT) Received: from outbound.mailhop.org (outbound.mailhop.org [63.208.196.171]) by svr1.postgresql.org (Postfix) with ESMTP id 7AD36D1B342 for ; Wed, 7 Jul 2004 16:19:20 -0300 (ADT) Received: from ool-4350c7ad.dyn.optonline.net ([67.80.199.173] helo=[192.168.0.66]) by outbound.mailhop.org with asmtp (TLSv1:AES256-SHA:256) (Exim 4.20) id 1BiHwu-00001o-Ki; Wed, 07 Jul 2004 15:19:21 -0400 Message-ID: <40EC4C36.1050608@zeut.net> Date: Wed, 07 Jul 2004 15:17:10 -0400 From: "Matthew T. O'Connor" User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Missner, T. R." Cc: pgsql-performance@postgresql.org Subject: Re: inserting into brand new database faster than old database References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Mail-Handler: MailHop Outbound by DynDNS.org X-Originating-IP: 67.80.199.173 X-Report-Abuse-To: abuse@dyndns.org (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: zeut X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/26 X-Sequence-Number: 7417 I don't think I have enough detail about your app. Couple of questions, are there any tables that recieve a lot of inserts / updates / deletes that are not deleted and recreated often? If so, one possibility is that you don't have a large enough FSM settings and your table is actually growing despite using autovac. Does that sounds possbile to you? Missner, T. R. wrote: > Hello, > > I have been a happy postgresql developer for a few years now. Recently > I have discovered a very strange phenomenon in regards to inserting > rows. > > My app inserts millions of records a day, averaging about 30 rows a > second. I use autovac to make sure my stats and indexes are up to date. > Rarely are rows ever deleted. Each day a brand new set of tables is > created and eventually the old tables are dropped. The app calls > functions which based on some simple logic perform the correct inserts. > > > The problem I am seeing is that after a particular database gets kinda > old, say a couple of months, performance begins to degrade. Even after > creating brand new tables my insert speed is slow in comparison ( by a > magnitude of 5 or more ) with a brand new schema which has the exact > same tables. I am running on an IBM 360 dual processor Linux server > with a 100 gig raid array spanning 5 scsi disks. The machine has 1 gig > of ram of which 500 meg is dedicated to Postgresql. > > Just to be clear, the question I have is why would a brand new db schema > allow inserts faster than an older schema with brand new tables? Since > the tables are empty to start, vacuuming should not be an issue at all. > Each schema is identical in every way except the db name and creation > date. > > Any ideas are appreciated. > > Thanks, > > T.R. Missner > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match >