I have a database table tblDetails with following fields:
itemID(int)(primary), itemCode(varchar), itemName(varchar),itemDescription(varchar)
Now this table has more than 50,000 rows and will keep increasing. When the user enters a itemCode, the query should go through the entire table to check if the itemCode entered by the user is valid or not. So my concern is the time consumed in searching the database as the number of rows increases.
Is there a better way to search a database? Is there a better database design? How much time(approx.) will it take to query 50 thousand rows?
Please suggest.
Create an index on itemCode, if itemCode is unique for your table, then make it a primary key, it will get a clustered index on it and will be much faster to access