Re: Optimizing POSTGRESQL config - Mailing list pgsql-novice

From Tom Lane
Subject Re: Optimizing POSTGRESQL config
Date
Msg-id 16140.1051798436@sss.pgh.pa.us
Whole thread Raw
In response to Optimizing POSTGRESQL config  (Joanne Formoso <joanneformoso@yahoo.com>)
List pgsql-novice
Joanne Formoso <joanneformoso@yahoo.com> writes:
> I'm new to POSTGRESQL but me and my friend are trying
> to benchmark the database by populating one table with
> 100,000 records, affecting around 5 columns in one
> row.  The problem is our processing time is very
> slow...around 30 minutes to 1 hour.  There are times
> it just hangs and stop execution.  I was just
> wondering if this was normal.

Seems mighty slow --- but it's impossible to really tell with this lack
of information.  Show us the table schema, the actual query, and
EXPLAIN's output for the query (or better yet, EXPLAIN ANALYZE),
and then you might get some useful advice.

Of course there's the standard newbie mistake: have you run VACUUM
and/or ANALYZE on this table?  You might also care to boost the
shared_buffers setting, which is unreasonably low out-of-the-box.

> We structured our PHP code in such a way that isn't
> optimized in order to isolate possible problems with
> the database.

Are you sure it's not the PHP code that's the problem?  One way to
investigate is to watch "top" while running your test.  If the php
process is taking more CPU than the postgres backend, then I'd look
to fixing the PHP side first ...

            regards, tom lane


pgsql-novice by date:

Previous
From: Joanne Formoso
Date:
Subject: Optimizing POSTGRESQL config
Next
From: radha.manohar@ndsu.nodak.edu
Date:
Subject: Re: Installing postgres in home directory