![]() |
|
#1
|
|||
|
|||
Optimize IP Range JoinI have 2 tables: an IP Address table, and an IP Ranges table. I want to retrieve a list of ranges in the ranges table for which one or more of the IP addresses in the IP address table fall within that range. The IP addresses are represented as integers, and the IP ranges are non-overlapping.
What I'm trying to use is this: Code:
but it takes too long. Is there a better way? Here is the structure: Code:
This is similar but different from this: forums.mysql.com I've tried several different combinations of indexes, but no success. Code:
Code:
|
|||
|
#2
|
||||
|
||||
Re: Optimize IP Range JoinJust a couple of 'formality' questions...
1. what version of MySQL do you have? 2. how do you define "takes too long"? 3. Are you getting some strange Cartesian product from the tables, perhaps? I'm not clear on how the JOIN with 'ip' could be working (unless that is general form or something), as there is not an 'ip' field in the ranges table. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with MySQL join | Blake | MySQL / PHP Forum | 5 | 13-Feb-2007 09:02 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 20:23 |
| earn money google directory | limkockchuan | Advertising & Affiliates Forum | 0 | 26-Nov-2006 05:29 |
| Need help generating a random number | Allie | C Programming Language | 7 | 09-Nov-2005 23:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The