Skip site navigation (1) Skip section navigation (2)

Re: indexes and keys

From: Ryan Bradetich <ryan_bradetich(at)hp(dot)com>
To: Andrew Perrin - Demography <aperrin(at)demog(dot)berkeley(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: indexes and keys
Date: 2000-04-17 06:09:18
Message-ID: 38FAAA8E.A21C273F@hp.com (view raw or flat)
Thread:
Lists: pgsql-sql
Andrew,

The one created should be sufficient.  You can check to make sure
it fits your needs exactly by: \d <index name>

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(at)demog(dot)berkeley(dot)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




In response to

pgsql-sql by date

Next:From: J.PostDate: 2000-04-17 14:26:41
Subject: Connecting website with SQL-database.....
Previous:From: Tom LaneDate: 2000-04-17 06:03:44
Subject: Re: indexes and keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group