X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 715758B9F74 for ; Tue, 8 Feb 2005 18:09:09 +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 40926-04 for ; Tue, 8 Feb 2005 18:08:58 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.198]) by svr1.postgresql.org (Postfix) with ESMTP id 1DCC48B9F77 for ; Tue, 8 Feb 2005 18:08:58 +0000 (GMT) Received: by rproxy.gmail.com with SMTP id b11so894278rne for ; Tue, 08 Feb 2005 10:08:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=JPxem5IDG3GOKog8npHP6YLHqh4I06NCpJKw8CofkomCAbdeZVvLahm67VFM07Zo5bXpIiKwp/MXmleU/ZqPr6Z8zuQBlP4rkG++u7Zg3Z3TgmQ9rabSCmRMBpgM/bJml4kW66KpZGq8TU7qxi+jRpdnTTDcjOpuncKGDLjFhEs= Received: by 10.38.98.65 with SMTP id v65mr153067rnb; Tue, 08 Feb 2005 10:08:55 -0800 (PST) Received: by 10.38.162.13 with HTTP; Tue, 8 Feb 2005 10:08:55 -0800 (PST) Message-ID: <59d991c405020810082a3683f7@mail.gmail.com> Date: Tue, 8 Feb 2005 13:08:55 -0500 From: Christopher Petrilli Reply-To: Christopher Petrilli To: Shashi Gireddy Subject: Re: too slow Cc: pgsql-admin@postgresql.org In-Reply-To: <5f447e3505020809517851420b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <5f447e3505020809517851420b@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200502/68 X-Sequence-Number: 16236 On Tue, 8 Feb 2005 11:51:22 -0600, Shashi Gireddy wrote: > I recently migrated from MySql, The database size in mysql was 1.4GB > (It is a static database). It generated a dump file (.sql) of size > 8GB), It took 2days to import the whole thing into postgres. After all > the response from postgres is a disaster. It took 40sec's to run a > select count(logrecno) from sf10001; which generated a value 197569. > And It took for ever time to display the table. How to optimize the > database so that I can expect faster access to data. > > each table has 70 colsX197569 rows (static data), like that I have 40 > tables, Everything static. > > system configuration: p4 2.8ghz 512mb ram os: xp postgres version: 8.0 A couple things... 1. Did you run VACCUM ANALYZE on the database after importing? 2. Did you use COPY or INSERT to get data into the database? THere's an almost 100x difference. 3. What does the schema look like. count(foo) is an expensive operation on PostgreSQL (and Oracle), because of the multi-version system, so it's something that you shouldn't use if you can avoid it. Other than that, I've found PostgreSQL to be much faster than MySQL when under load, and when mutliple people are involved, especially if there's a writer anywhere. Chrs -- | Christopher Petrilli | petrilli@gmail.com