Hello
i have a table with lots of records(11 million). The records has a foreign ID, Date and some other fields.
I have a query which i run in my application so often. The query is something like:
if( SELECT * FROM myTable WHERE Date=@Date AND ForeignID=@ForeignID != 0 )
UPDATE myTable SET ....... WHERE Date=@Date AND ForeignID=@ForeignID
else
INSERT INTO myTable(......) VALUES(.....)
I want to add "Date" as a nonclustered index. Then if i add "ForeignID" column as included column for that index, will it help the query executes faster?
Thanks.