Received: from www-uk-05.digiserve.com ([195.97.231.11]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3564M856133 for ; Thu, 5 Apr 2001 02:04:22 -0400 (EDT) (envelope-from dev@archonet.com) Received: from mainbox.archonet.com (mwynhau.demon.co.uk [193.237.186.96]) by www-uk-05.digiserve.com (8.9.1/8.9.1) with ESMTP id HAA19331; Thu, 5 Apr 2001 07:05:14 +0100 (BST) Received: from archonet.com (ibook.archonet.com [192.168.1.32]) by mainbox.archonet.com (Postfix) with ESMTP id 5AD222A3AB; Wed, 4 Apr 2001 21:35:30 +0100 (BST) Message-ID: <3ACB8562.FC449374@archonet.com> Date: Wed, 04 Apr 2001 21:34:45 +0100 From: Richard Huxton X-Mailer: Mozilla 4.7C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; I; PPC) X-Accept-Language: en MIME-Version: 1.0 To: edipoelder@ig.com.br Cc: pgsql-sql@postgresql.org Subject: Re: Memory and performance References: <200104041715.f34HF8858323@postgresql.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200104/73 X-Sequence-Number: 2413 edipoelder@ig.com.br wrote: > > Hi all, > > I have noted that Postgresql don't make a good memory handle. I have > made the tables/procedure (in attached file) and run it as "select bench(10, > 5000)". This will give a 50000 records inserts (5 x 10000). (well, I run it > on a P200+64MB of RAM, under Linux, and Postgres 7.0.2. In a more powerfull > machine, you can try other values). That's 50,000 inserts in one transaction - have you tried 50 transactions of 1000 inserts? > I get as result, the following times: > 5 | group 5 | 00:02:08 > > Note that, with memory increse, the system becomes slow, even if the > system has free memory to alocate (yes, 64MB is enough to this test). I > didn't see the source code (yet), but I think that the data estructure used > to keep the changed records is a kind of chained list; and to insert a new > item, you have to walk to the end of this list. Can it be otimized? I don't fancy your chances before 7.1 ;-) > The system that I'm developing, I have about 25000 (persons) x 8 (exams) > x 15 (answers per exam) = 3000000 records to process and it is VERY SLOW. If you need to import large quantities of data, look at the copy command, that tends to be faster. - Richard Huxton