X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E732C56385 for ; Tue, 8 Mar 2005 17:36:02 +0000 (GMT) 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 42540-04 for ; Tue, 8 Mar 2005 17:35:54 +0000 (GMT) Received: from hogranch.com (hogranch.com [66.117.128.240]) by svr1.postgresql.org (Postfix) with ESMTP id E8A3F56369 for ; Tue, 8 Mar 2005 17:35:53 +0000 (GMT) Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id j28HZjE04248 for ; Tue, 8 Mar 2005 09:35:45 -0800 Message-ID: <422DE271.5010701@hogranch.com> Date: Tue, 08 Mar 2005 09:35:45 -0800 From: John R Pierce User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Postgres is slow References: <6bf1b0a005030805495ec76763@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/68 X-Sequence-Number: 12461 >>I am using Postgres 7.4 on Fedora 3.0. It is running with the default >>configuration. .... > Probably this is not the right list for this. > Did you run vacuum after inserting the records? > Check your statement with explain analyze, it will show you why is it > slow. also, check serverlog in the data directory (/var/pgsql/data is the Redhat/Fedora default, I believe). If you're logging lots of errors, that file will grow, and they don't manage it. also, the defaults in $PGDATA/postgresql.conf in 7.4 are *VERY* inefficient. there are a few key parameters that can make a significant difference in overall performance. and, crontab (from the postgres user account) a vacuumdb every hour or so if you're doing lots of activity. once a day or week, do a vacuumdb -z to reindex stuff. and, shut postgres down, mv the $PGDATA directory to a different dedicated physical disk drive, and symlink it, then restart postgres. I've found that 7.x pgsql databases periodically need to be pg_dump'd, dropdb, then reloaded from the dump to continue to perform well... on a heavy use web server database which includes a busy user forum, I find doing this about 2-3 times a year keeps things smooth. there may be a better way to clean them up, but I've not found it.