Re: Do I need this index?

From: Bliss <bliss_is_ignorance_at_hotmail.com>
Date: Wed, 21 Nov 2001 00:58:16 +0800
Message-ID: <3bfa8b93_2_at_news.tm.net.my>


Hi Jim,

When the primary key is a composite key, the index will be used if you query on the first column of the composite key.... hence the index Ix_FolderFolderCid is not required...

Hope this helps....

Regards,
Bliss

"jim nash" <jim_nash_at_yahoo.com> wrote in message news:6ef12c.0111191645.3eedfee5_at_posting.google.com...
> I have a table defined as:
>
> CREATE TABLE FOLDERENVELOPES(
> FOLDERID INTEGER Not Null,
> ENVELOPEID INTEGER Not Null,
> CONSTRAINT PK_FOLDERENVELOPES PRIMARY KEY ( FOLDERID, ENVELOPEID )
> );
>
> CREATE INDEX IX_FOLDERFOLDERCID ON FOLDERENVELOPES( FOLDERID );
>
> CREATE INDEX IX_FOLDERENVELOPECID ON FOLDERENVELOPES( ENVELOPEID );
>
> The table may have several hundred thousand rows.
>
> As the primary key may used for indexed access via both FOLDERID and
> {FOLDERID, ENVELOPEID}, is there any value to IX_FOLDERFOLDERCID ?
>
> Thx
>
> - Jim
Received on Tue Nov 20 2001 - 17:58:16 CET

Original text of this message