Automatic index creation for unique columns

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic index creation for unique columns

Eggert, Henri

Hi all,

Can anyone confirm following ?

Create table t ( t1 integer primary key , t2 text unique , t3 ... )
The table is created with 2 indexes :
First index : t1 ( the primary key )
Second index : t2 because t2 has the attribute unique

Thank's in advance

Henri


Reply | Threaded
Open this post in threaded view
|

Re: Automatic index creation for unique columns

Christian Smith
On Fri, 16 Dec 2005, Eggert, Henri wrote:

>
>Hi all,
>
>Can anyone confirm following ?
>
>Create table t ( t1 integer primary key , t2 text unique , t3 ... )
>The table is created with 2 indexes :
>First index : t1 ( the primary key )
>Second index : t2 because t2 has the attribute unique


Being a pedant, no, there is only one external index (on t2). t1, being an
integer primary key, is the row Id and keyed directly in the table.

Nitpicking aside, yes. t2 is indexed.


>
>Thank's in advance
>
>Henri
>

Christian

--
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \