From: Burak Seydioglu <buraks78@gmail.com>
To: pgsql-performance@postgresql.org
Subject: indexes on primary and foreign keys
Date: Wed, 11 Jan 2006 14:38:42 -0800
Message-ID: <1b8a973c0601111438m3e0b1cc0hf9c387a4a1d6791d@mail.gmail.com> (raw)
I do a load of sql joins using primary and foreign keys. What i would like
to know if PostgreSQL creates indexes on these columns automatically (in
addition to using them to maintain referential integrity) or do I have to
create an index manually on these columns as indicated below?
CREATE TABLE cities (
city_id integer primary key,
city_name varchar(50)
);
CREATE INDEX city_id_index ON cities(city_id);
Thanks for any insight.
Burak
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-performance@postgresql.org
Cc: buraks78@gmail.com
Subject: Re: indexes on primary and foreign keys
In-Reply-To: <1b8a973c0601111438m3e0b1cc0hf9c387a4a1d6791d@mail.gmail.com>
References: <1b8a973c0601111438m3e0b1cc0hf9c387a4a1d6791d@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