From: Andrew Perrin - Demography <aperrin@demog.berkeley.edu>
To: pgsql-sql@postgresql.org
Subject: indexes and keys
Date: Sun, 16 Apr 2000 22:01:17 -0700 (PDT)
Message-ID: <Pine.SUN.4.10.10004162158200.2584-100000@davis.DEMOG.Berkeley.EDU> (raw)
Greetings - I hope this is a simple question.
Is there any reason to create an index on a column that already has one
created as part of a SERIAL datatype? That is, I used:
CREATE TABLE personal_data (id serial ...);
to create it, so \d shows:
| postgres | personal_data | table |
| postgres | personal_data | table |
| postgres | personal_data_id_key | index |
| postgres | personal_data_id_seq | sequence |
is there any reason to create another index on id:
CREATE INDEX pd_id_idx on personal_data;
or will the automatically created one be sufficient?
Thanks.
---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography - University of California at Berkeley
2232 Piedmont Avenue #2120 - Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
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-sql@postgresql.org
Cc: aperrin@demog.berkeley.edu
Subject: Re: indexes and keys
In-Reply-To: <Pine.SUN.4.10.10004162158200.2584-100000@davis.DEMOG.Berkeley.EDU>
References: <Pine.SUN.4.10.10004162158200.2584-100000@davis.DEMOG.Berkeley.EDU>
* 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