SQL view - indexing help
Posted on 2011-03-25
We get a datafile from a vendor which I want to use for a view and create my own "summary" columns based on multiple columns.
CASE WHEN LEFT(Status, 2) = "EM" OR Emergency = "Y" THEN "Emergency" ELSE "Standard" END AS 'Recordstatus'
(this is somewhat simplified)
That way the users in Access can simply say "Where recordstatus = 'Emergency' " and it will pull all the necessary combinations.
My question is, should I put an index on the Emergency and the Status column - will that have an effect on the query performance?
Should it be a combined index or should each column have a separate index?