X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 078FBDBBF9 for ; Sat, 19 Nov 2005 06:51:49 -0400 (AST) 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 06609-03 for ; Sat, 19 Nov 2005 10:51:51 +0000 (GMT) X-Greylist: delayed 03:05:18.766441 by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 34B15DBBD3 for ; Sat, 19 Nov 2005 06:51:47 -0400 (AST) Received: from alexwang.com (alexwang.com [220.132.178.72]) by svr2.postgresql.org (Postfix) with ESMTP id 34773F0B8E for ; Sat, 19 Nov 2005 07:46:27 +0000 (GMT) Received: from alexxp ([192.168.0.2]) (authenticated bits=0) by alexwang.com (8.13.5/8.13.5) with ESMTP id jAJ7kmej017555 for ; Sat, 19 Nov 2005 15:46:49 +0800 (CST) Message-ID: <002601c5ecdd$503279e0$0200a8c0@alexxp> From: "Alex Wang" To: Subject: VERY slow after many updates Date: Sat, 19 Nov 2005 15:46:06 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="big5"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-twbsd-MailScanner-Information: Please contact the ISP for more information X-twbsd-MailScanner: Found to be clean X-twbsd-MailScanner-From: alex@alexwang.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/392 X-Sequence-Number: 15649 I am using PostgreSQL in an embedded system which has only 32 or 64 MB RAM (run on PPC 266 MHz or ARM 266MHz CPU). I have a table to keep downlaod tasks. There is a daemon keep looking up the table and fork a new process to download data from internet. Daemon: . Check the table every 5 seconds . Fork a download process to download if there is new task Downlaod process (there are 5 download process max): . Update the download rate and downloaded size every 3 seconds. At begining, everything just fine. The speed is good. But after 24 hours, the speed to access database become very very slow. Even I stop all processes, restart PostgreSQL and use psql to select data, this speed is still very very slow (a SQL command takes more than 2 seconds). It is a small table. There are only 8 records in the table. The only way to solve it is remove all database, run initdb, create new database and insert new records. I tried to run vacummdb but still very slow. Any idea to make it faster? Thanks, Alex -- Here is the table schema: create table download_queue ( task_id SERIAL, username varchar(128), pid int, url text, filename varchar(1024), status int, created_time int, started_time int, total_size int8, current_size int8, current_rate int, CONSTRAINT download_queue_pkey PRIMARY KEY(task_id) ); CREATE INDEX download_queue_user_index ON download_queue USING BTREE (username); -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.