I have a table which has the following columns
Id (int)
UniqueId (string)
CategoryId (int)
Id and UniqueId are unique for each record.
I want to find a record based on UniqueId value, and i also have the CategoryId value.
Is it faster to specify both filters in the SELECT statement, for example:
SELECT * FROM [Products] Where [UniqueId] = 'product' AND [CategoryId] = 4
Or should i just use the [UniqueId] filter?
The table has a lot of records
EDIT :
I don’t have the [Id] column of the product
I suggest,Just create a non-clustered index on uniqueid and just use that field as filter