Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 116969FB382 for ; Thu, 22 Feb 2007 14:42:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 14085-04 for ; Thu, 22 Feb 2007 14:42:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 9B01F9FB408 for ; Thu, 22 Feb 2007 14:42:17 -0400 (AST) Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l1MIgHlo025583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Feb 2007 10:42:17 -0800 Message-ID: <45DDE41F.6090907@commandprompt.com> Date: Thu, 22 Feb 2007 10:42:39 -0800 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: gabriel.biberian@beemotechnologie.com CC: pgsql-performance@postgresql.org Subject: Re: slow update on 1M rows (worse with indexes) References: <45DDDCDE.9050806@beemotechnologie.com> In-Reply-To: <45DDDCDE.9050806@beemotechnologie.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 22 Feb 2007 10:42:18 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/232 X-Sequence-Number: 23286 n i tried adding an index to the table on the column date (int) that > stores unix timestamps. > TOTO=# CREATE INDEX versions_index ON versions_9d (date); > (-60M) disk space goes down on index creation > beebox@evobrik01:~$ time psql TOTO -c "UPDATE versions_9d SET flag=9" > UPDATE 976009 > real 3m8.219s (+328M) > beebox@evobrik01:~$ time psql TOTO -c "UPDATE versions_9d SET flag=8" > UPDATE 976009 > real 6m24.716s (+326M) > beebox@evobrik01:~$ time psql TOTO -c "UPDATE versions_9d SET flag=10" > UPDATE 976009 > real 8m25.274s (+321M) > > As a sanity check, i loaded mysql5 and tried the same database and > updates. With mysql, the update always lasts ~8s. Yes but with mysql did you use myisam or innodb? > The conclusions I have come to is that update==insert+delete which seems > very heavy when index are present (and heavy disk wise on big tables). > Is there a switch i can flip to optimise this? > > Thanks in advance, > Gabriel Biberian > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/