tag:blogger.com,1999:blog-17155656.post112821868990963275..comments2023-04-06T12:09:13.895+02:00Comments on db4free.net blog: Locate IP addressesMarkus Popphttp://www.blogger.com/profile/15355530354397508921noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-17155656.post-78940807452564013162007-12-04T06:35:00.000+01:002007-12-04T06:35:00.000+01:00I found that when using ip's from Australia the qu...I found that when using ip's from Australia the query time was significantly higher, and would at some stage stop using the index for table "b" (ip_countries) and perform a full search.<BR/><BR/>I wrote up a different query which seems to work a treat:<BR/><STRONG>select straight_join b.country from ip_ranges a, ip_countries b where a.ip_from<=3405775035 and a.ip_to>=3405775035 and b.code=a.code limit 1;</STRONG><BR/><BR/>The straight_join ensures that the table join order is the same as described in the from section of the query, and that the index is used.Unknownhttps://www.blogger.com/profile/09463898285555525962noreply@blogger.comtag:blogger.com,1999:blog-17155656.post-80183933906517270062007-09-09T02:24:00.000+02:002007-09-09T02:24:00.000+02:00Just a hint, mysql already has INET_ATON() builtin...Just a hint, mysql already has INET_ATON() builtin function to convert an IP address to it's numeric representation.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-17155656.post-78939229820705646852007-04-19T02:04:00.000+02:002007-04-19T02:04:00.000+02:00You can also show an image on your website to show...You can also show an image on your website to show <A HREF="www.findmyipaddress.info" REL="nofollow">visitor IP address and country flag</A>. Just go to the website <A HREF="www.findmyipaddres.info" REL="nofollow">findmyipaddress.info</A>. copy the code and paste it in your websiteUnknownhttps://www.blogger.com/profile/03208638244760626591noreply@blogger.comtag:blogger.com,1999:blog-17155656.post-1161212865439580062006-10-19T01:07:00.000+02:002006-10-19T01:07:00.000+02:00Many Thanks ... very helpful ...Many Thanks ... very helpful ...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-17155656.post-1146500717166273722006-05-01T18:25:00.000+02:002006-05-01T18:25:00.000+02:00thank you :)thank you :)M.Medhttps://www.blogger.com/profile/16995090820151338596noreply@blogger.com