|Subject||Re: Indeks on primary key|
> > If I have a table where there is a primary key on field1 andAssuming this index to be created as (field1, field2), you could in
> > field2. Do I then gain anything from making an index on both
> > fields or a combined on both fields ?
> If you have a primary key constraint on those fields, an index is
> automatically created.
some cases benefit from having a separate index for field2 since the
primary key index would only be useful for queries also specifying
field1 (it does matter in which order you specify the fields within
Myself, I try to only use one field without any meaning for the PK, it
makes things simple.
Foreign keys also create indexes.