Re: Performance Issues

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Performance Issues
Date: 2006-05-23 12:12:48
Message-ID: 878xotdjnj.fsf@suzuka.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM> writes:

> I have the following doubts.
>
> 1. Does postgres create an index on every primary key? Usually,
> queries are performed against a table on the primary key, so, an index
> on it will be very useful.

To enforce the primary key constraint, PG creates a unique index when
the table is created (I think it even tells you this after CREATE
TABLE).

> 2. If 'm executing a complex query and it takes 10 seconds to return
> the results -- it takes 10 seconds to execute the next time also. I'm
> wondering if there's any kind of caching that can be enabled -- so,
> the next time it takes <10 seconds to return the results.

All kinds of data is cached in shared memory. Did you tune the
shared_buffers setting in postgresql.conf? It's set quite low by
default to make sure the server can start on systems with low shared
memory limits.

The online documentation has this info and lots more--I suggest you
read it.

-Doug

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-23 13:37:56 Re: error-free disabling of individual child partition
Previous Message Dhanaraj M 2006-05-23 11:55:11 Performance Issues