Received: from gunni.com (matrix.gunni.com [193.4.185.20]) by hub.org (8.9.3/8.9.3) with ESMTP id UAA25369; Tue, 20 Jul 1999 20:03:33 -0400 (EDT) (envelope-from gunni@if.is) Received: from gunni (utstod1.gi.hf.is [192.168.222.101]) by gunni.com (Secure) with SMTP id XAA07450; Tue, 20 Jul 1999 23:54:25 GMT Posted-Date: Tue, 20 Jul 1999 23:54:25 GMT Reply-To: From: "Gunnar Ingvi Thorisson" To: , Subject: Bad update performance? Date: Wed, 21 Jul 1999 00:06:15 +0100 Message-ID: <000001bed304$78193380$65dea8c0@gunni.gi.hf.is> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-reply-to: <199907201401.KAA03008@ll.mit.edu> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Hi there, I´ve a table with about 142000 rows like shown below and I want to set field "divis" to "unknown" by executing following update command: update ipacct set divis = 'unknown'; However this seems to take hours, I´ve a PII 350MHz with 192Mb memory and Quantum UIDE disk, is there a way for me to speed up the update process except for switching to a SCSI hard drive? Does indexing the field "divis" speed up the update performance? The load on the machine is about 1,5 to 2 all the time and it´s hacking on the hard drive like hell. I´ve the same problem when I do "UPDATE ipacct SET traf = (src+dst)", it takes hours. Is this normal? Is there another way to do this? However reading from the database doing select is very fast. Many thanks in advance for any hint, best regards, Gunnar Ingvi Thorisson CCIE 4826 Iceland gunni@if.is venus:~$ psql ipacct Welcome to the POSTGRESQL interactive sql monitor: Please read the file COPYRIGHT for copyright terms of POSTGRESQL [PostgreSQL 6.5.0 on i686-pc-linux-gnulibc1, compiled by gcc 2.7.2.3] [cut] ipacct=> select * from ipacct where id = 1; id| datetime|pcol|saddr |sport|daddr |dport|pcnt| size|if |login |mac |src|dst|traf|depart|divis --+---------+----+-----------------+-----+------------+-----+----+-----+---- +-------+------------+---+---+----+------+----- 1|928368167| 6|209.85.127.151/32| 80|10.10.2.3/32| 2448| 57|74856|eth0|unknown|00805FC1525C|100| 3| 103| | (1 row) ipacct=> update ipacct set divis = 'unknown'; The table: ID INT4 UNIQUE, DATETIME TEXT, PCOL INTEGER, SADDR CIDR, SPORT INTEGER, DADDR CIDR, DPORT INTEGER, PCNT INT4 SIZE INT4; IF TEXT; LOGIN TEXT; MAC TEXT; SRC INTEGER; DST INTEGER; TRAF INTEGER; DEPART TEXT; DIVIS TEXT;