블로그 이미지
LifeisSimple

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Notice

2011. 6. 14. 12:25 Brain Trainning/DataBase
GeoIP용 쿼리 

AMD Opteron 2.4G 에서 70번 정도 수행
(StartIPNum에 Unique 하지 않은 값이 있을 수 있으므로 문제가 될 수 있음)

declare @IPNum bigint

 

select @IPNum = convert(bigint, dbo.UFConvertIP('X', '180.70.93.57'));

 

with IPS as (

select top 5 endipnum, nationCD from dbo.T_GeoIPCountryWhois with (nolock) where @IPNum > startipnum order by startipnum desc

)

select top 1 nationCD

from IPS

where endipnum > @IPNum order by endipnum

posted by LifeisSimple