Storing URLs for later lookup

K

Kevin

Anyone hashing or storing URLs for later lookup? I was curious for the best
practices on storing such a wide column that needs indexing and if there
were alternatives. We have a table an are anticipating millions of rows and
want to look up the content through the URL, due to SQL server we have a 900
bytes restriction on the index. Would hashing be the way to go (and look up
via the hash) OR just limit the URL length to 450 nvarchar (900 bytes) and
put an index on the URL column.
 
G

Guest

I know this doesn't sound very unique, but consider storing the first 900
bytes in the indexed column and the full url in another wider column that
isn't indexed.
Peter
 
S

Steven Cheng[MSFT]

Hi Kevin,

Http specification doesn't have requirement or limitation on url length,
generally, it is the webbrowser that will restrict the length of url. e.g.

#Maximum URL length is 2,083 characters in Internet Explorer
http://support.microsoft.com/kb/208427

for your scenario, I also think Peter's suggestion on indexing on the first
900 characters of the url is reasonable since indexing should be performed
on a meaningful url value rather than the hashed value. hashed value is
good for comparing or identifying. Also, if you need to use the url
later(for navigation), you have to store the complete url in another
unindexed column since hashed value is not reversable.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hi Kevin,

Have you got any further idea on this? If you have any other questions on
this, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top