[algogeeks] Re: Judging whether a URL exists among millions, insert if not

2008-08-21 Thread Abdul Habra
two things: 1. select count(*) from table where HASH_CODE=hc and select count( HASH_CODE) from table where HASH_CODE=hc are equivalent 2. hash code uniquness is not guaranteed. Say your hash code is 32 bit signed integer. you could have at most 2^31 distinct hashcodes (roughly 2 billions). On

[algogeeks] Re: Judging whether a URL exists among millions, insert if not

2008-08-21 Thread Fred
On Aug 21, 12:38 pm, Ashish Chugh [EMAIL PROTECTED] wrote: Few more suggestions, Instead of select count(*) from table where HASH_CODE=hc and URL='urlToFind' to select count( HASH_CODE) from table where HASH_CODE=hc is better, since HASH_CODE is unique. You can cache all hash codes or