On Wed, Oct 15, 2003 at 03:25:59PM +0200, Paul J Stevens wrote:
> Caveat: I'm no sql guru.
> Rule of thumb: all fields used in where clauses should be indexed.

True.

> mysql has a nice sql command called 'explain select ...' which analyzes 
> usage of indexes for select queries. I don't know of a similar tool in 
> postgresql.

In PG you just put explain in front of your SQL query.  You can do it
for any query.

> AFAIK, the rule-of-thumb still applies for 2.0. I see hardly any indexes 
>   other than primary keys in the default tables for 2.0/postgresql, so I 
> guess adding them is required for any but the most trivial dbmail 
> installations.

I think that (depending on PG version) adding a primary key will
create a unique index on that field.  A primary key has to be unique,
so creating a unique index enforces that requirement.
 
Cordially
-- 
+--------------------------------------------------+
| Patrick Giagnocavo, [EMAIL PROTECTED]             |
| Zill.Net - OpenACS, Postgres, Lisp hosting       |
| OpenACS v4 shared server       $19.95/month      |
| Colocation w/50GB transfer     $99.00/month      |
| Managed servers (incl. system) $175/month        |
+--------------------------------------------------+

Reply via email to