|
-
Mar 6th, 2002, 05:04 PM
#1
Thread Starter
Fanatic Member
Using Index in Open Select statement
I have an SQL 2000 table that has a non clustered Index built. When using Select statements in VB to open this table, do I need to reference the Index that is built or is the Index automatically used? If not, what is the correct syntax for using the Index in my open statement?
Thanks
-
Mar 6th, 2002, 05:15 PM
#2
I do believe the nidex is automagically used.
-
Mar 7th, 2002, 07:42 AM
#3
Thread Starter
Fanatic Member
Multiple indexes
What if there are multiple indexs built? Does it automatically use the most efficient one?
-
Mar 7th, 2002, 09:34 AM
#4
I believe so. If anyone would care to rebut, be my guest.
-
Mar 7th, 2002, 10:31 AM
#5
Fanatic Member
The wrong index can be used. In the case of multiple indexes, you can specify the one that you want to use as thus.
SELECT blah
FROM blah (INDEX = indexname)
or something like that.
The liver is bad. It must be punished.
-
Mar 7th, 2002, 10:34 AM
#6
Fanatic Member
I would rely on SQL server getting it right 99.10102099919% of the time tho...
Leather Face is comin...
MCSD
-
Mar 7th, 2002, 10:38 AM
#7
Fanatic Member
True, but in my experience on VLDB's with several indexes on a table, the wrong one has been used. This is more likely on views with many tables and JOINS. Otherwise you're right.
nb - you're 0.004352001 out
The liver is bad. It must be punished.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|