I have a table which has a Guid primary key. The table contains around 400,000 rows, and the expectation is that it will increase up into the low millions, depending on external factors.
The table has around 90 columns, two of which contain data i want to query by.
Basically, my query looks like the following:
Select * from table1
where col1 = @value or col2 = @value
At the moment, it takes around 35 seconds to retrieve all data (400,000 records), and around 1 second to for the above query to run using the temp variable @value (roughly 20,000 records)
What methods can i implement to improve the query performance? I currently have a nonclustered index on the primary key - should another index be added on col1 / col2?
Any ideas are appreciated. I can envision a query like this one day returning 400,000 records, and i want it to be as quick as possible.