Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B80BB2E2E57 for ; Fri, 14 Dec 2007 20:11:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 32287-10 for ; Fri, 14 Dec 2007 20:11:24 -0400 (AST) Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by postgresql.org (Postfix) with ESMTP id 166B12E2DE4 for ; Fri, 14 Dec 2007 20:11:23 -0400 (AST) Received: from smtp6-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp6-g19.free.fr (Postfix) with ESMTP id 7C77F5FD76 for ; Sat, 15 Dec 2007 01:11:22 +0100 (CET) Received: from imp4-g19.free.fr (imp4-g19.free.fr [212.27.42.4]) by smtp6-g19.free.fr (Postfix) with ESMTP id 70BDC5FD5B for ; Sat, 15 Dec 2007 01:11:22 +0100 (CET) Received: by imp4-g19.free.fr (Postfix, from userid 33) id 6880D7760; Sat, 15 Dec 2007 01:11:22 +0100 (CET) Received: from vau75-8-82-239-200-176.fbx.proxad.net (vau75-8-82-239-200-176.fbx.proxad.net [82.239.200.176]) by imp.free.fr (IMP) with HTTP for ; Sat, 15 Dec 2007 01:11:22 +0100 Message-ID: <1197677482.47631baa4052a@imp.free.fr> Date: Sat, 15 Dec 2007 01:11:22 +0100 From: okparanoid@free.fr To: pgsql-performance@postgresql.org Subject: update 600000 rows MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.5 X-Originating-IP: 82.239.200.176 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/233 X-Sequence-Number: 28049 Hello i have a python script to update 600000 rows to one table from a csv file in my postgres database and it takes me 5 hours to do the transaction... I'm on debian etch with 8.1 postgres server on a 64 bits quad bi opteron. I have desactived all index except the primary key who is not updated since it's the reference column of the update too. When i run this script the server is not used by any other user. First when i run htop i see that the memory used is never more than 150 MB. I don't understand in this case why setting shmall and shmmax kernel's parameters to 16 GB of memory (the server has 32 GB) increase the rapidity of the transaction a lot compared to a shmall and shmax in (only) 2 GB ?! The script is run with only one transaction and pause by moment to let the time to postgres to write data to disk. If the data were writed at the end of the transaction will be the perfomance better ? i wan't that in production data regulary writed to disk to prevent loosinf of data but it there any interest to write temporary data in disk in a middle of a transaction ??? I'm completely noob to postgres and database configuration and help are welcome. thanks