"how would that help in knowning if it is using the index correctly? I guess technically since I am pulling from a column that has an Index on it it "should" be using it, but I am not sure that it is." By knowing what query is passed, you can make an educated guess about whether an index would be used. Since the parameter is being correctly passed to the DBMS, you know that at this point the DBMS query engine has the info it needs to potentially use the index. Now it's up to the query engine to decide whether or not to use it. You can read entire books on indexing and optimization. There are many queries that SAS has a hard time converting into SQL that can be processed by the DBMS -- in those cases, SAS pulls down the entire contents of the table and processes the query locally. You want to avoid this, except on small tables where it doesn't really matter. BTW, IMHO text strings don't make great indexes unless they are very highly selective -- the usual rule of thumb is indexes are useful if they return less than ~15% of the data, but with a text string, I'd use a rule of thumb more like less than 5%. So something like a person's last name is good, but something like college major where you have about 30 different values, that's not so great. This is starting to dip into that huge topic of indexing.
... View more