Re: Performance Issues - Mailing list pgsql-hackers

From Douglas McNaught
Subject Re: Performance Issues
Date
Msg-id 878xotdjnj.fsf@suzuka.mcnaught.org
Whole thread Raw
In response to Performance Issues  (Dhanaraj M <Dhanaraj.M@Sun.COM>)
List pgsql-hackers
Dhanaraj M <Dhanaraj.M@Sun.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


pgsql-hackers by date:

Previous
From: Dhanaraj M
Date:
Subject: Performance Issues
Next
From: Tom Lane
Date:
Subject: Re: error-free disabling of individual child partition