By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,107 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,107 IT Pros & Developers. It's quick & easy.

Storing URLs for later lookup

P: n/a
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.

May 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Kevin" wrote:
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.
May 25 '07 #2

P: n/a
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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


May 28 '07 #3

P: n/a
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.

May 30 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.