I have a some data in one table which has rules about its validity stored in another table. The combinations leading to a valid / non valid bits and or dates being returned are quite complex but very slowly changing. I have created a view on the combined data. There are at least two options which I'm looking and need to check if there anyone knows of any gotchas:
- Create a complex case statement within the view and build an indexes on the resultant columns
- Create a computed columns on the view and build an indexes on the computed columns
- Create n inline functions within the view and build an index on the resultant columns
I inherently like 1 as it seems more explicit however there may be some under the hood reasons for the other options or indeed another approach.
Any views (ouch) on this please? Yes I know the answer may be do all three and compare results, but I'd like to get a line on how valid those tests might be.