pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Petrilli <petrilli@gmail.com>
To: Shashi Gireddy <gireddy@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: too slow
Date: Tue, 8 Feb 2005 13:08:55 -0500
Message-ID: <59d991c405020810082a3683f7@mail.gmail.com> (raw)
In-Reply-To: <5f447e3505020809517851420b@mail.gmail.com>
References: <5f447e3505020809517851420b@mail.gmail.com>

On Tue, 8 Feb 2005 11:51:22 -0600, Shashi Gireddy <gireddy@gmail.com> 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



view thread (13+ messages)  latest in thread

Message-ID: <59d991c405020810082a3683f7@mail.gmail.com>
Permalink:  ../59d991c405020810082a3683f7@mail.gmail.com/
Also on:    postgresql.org/message-id/59d991c405020810082a3683f7@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: petrilli@gmail.com, gireddy@gmail.com
  Subject: Re: too slow
  In-Reply-To: <59d991c405020810082a3683f7@mail.gmail.com>
  References: <5f447e3505020809517851420b@mail.gmail.com> <59d991c405020810082a3683f7@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox