Received: from atlrel1.hp.com (atlrel1.hp.com [156.153.255.210]) by hub.org (8.9.3/8.9.3) with ESMTP id CAA96720 for ; Mon, 17 Apr 2000 02:09:28 -0400 (EDT) (envelope-from ryan_bradetich@hp.com) Received: from hpbs4813.boi.hp.com (hpbs4813.boi.hp.com [15.56.8.57]) by atlrel1.hp.com (Postfix) with ESMTP id ADCA41C3; Mon, 17 Apr 2000 02:09:20 -0400 (EDT) Received: from hp.com (root@hpbs4813.boi.hp.com [15.56.8.57]) by hpbs4813.boi.hp.com (8.9.3 (PHNE_18979)/8.9.3 SMKit6.0.6 OpenMail) with ESMTP id AAA10214; Mon, 17 Apr 2000 00:09:18 -0600 (MDT) Message-ID: <38FAAA8E.A21C273F@hp.com> Date: Mon, 17 Apr 2000 00:09:18 -0600 From: Ryan Bradetich X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.3.99-pre3 i686) X-Accept-Language: en MIME-Version: 1.0 To: Andrew Perrin - Demography Cc: pgsql-sql@postgresql.org Subject: Re: indexes and keys References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200004/163 Andrew, The one created should be sufficient. You can check to make sure it fits your needs exactly by: \d Ryan Andrew Perrin - Demography wrote: > 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 -- Ryan Bradetich AIT Operations Unix Platform Team