Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread How does ElevateDB choose which index
Fri, Mar 7 2008 7:36 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

If there are several indices on a field how does ElevateDB choose which one to use?

eg

CREATE INDEX "bert1" ON "HHLog" ("_UserID" COLLATE "ANSI" ASC)
CREATE INDEX "bert2" ON "HHLog" ("_UserID" COLLATE "ANSI_CI" ASC)
CREATE INDEX "bert3" ON "HHLog" ("_UserID" COLLATE "ANSI" DESC)
CREATE INDEX "down"ON "HHLog"("_UserID" COLLATE "CSY" DESC)

I'm guessing that it tries to match collation and direction from the field if not specified and what's specified if something is. Is that right?

Roy Lambert
Fri, Mar 7 2008 10:38 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I'm guessing that it tries to match collation and direction from the
field if not specified and what's specified if something is. Is that right?
>>

First it has to find the index that matches the search criteria in terms of
collation and the columns being searched.  Then, it grabs the smallest index
that satisfies all of the criteria.

Direction really doesn't play a part unless it's an ORDER BY clause that
needs the index.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Mar 7 2008 11:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>Then, it grabs the smallest index
>that satisfies all of the criteria.

I knew it size is important Smiley

Roy Lambert
Mon, Mar 10 2008 3:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I knew it size is important Smiley>>

Only if it's the correct one in the first place. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image