You can create a calculated column for the checksum of the URL, and then use the checksum in the query. Checksums will not be unique, but they will quickly reduce the number of possible matches.
First add the calculated column to your table, for example:
Alter Table YourTableName Add URL_HASH As CheckSum(URL)
Now index the column as follows:
Create Index idx_YourTableName_URL_HASH On YourTableName(URL_HASH)
Now you can write a query that will search the index to find the row you are looking for:
Select URL From YourTableName Where URL_HASH = CheckSum(N'google.com') And URL = 'google.com'
This method should work very well for exact matches. If you need partial matches, you'd better use full-text search.
G mastros
source share