MySQL database:
User table, about 2000 data, has an IP field (converted to an integer);
IP Address Table (IP), 440,000 data, an IP Start field and IP End field (converted to an integer), and IP Physical Address field;
Now you need to use SQL script to find the "user table" each record IP corresponding to the physical address, with the following SQL script query speed is too slow, waiting for a long time no results
Select User.*, ip.addressfrom user left join Ipon user.ip between Ip.ipstart and Ip.ipend
Ask for more efficient methods of inquiry, thank you
Reply to discussion (solution)
Press EXPLAIN information to adjust
Press EXPLAIN information to adjust
What do you mean, I don't understand, thank you!
Execute EXPLAIN your query instructions
MySQL will tell you where it might be optimized
Press EXPLAIN information to adjust
What do you mean, I don't understand, thank you!
Moderators mean you EXPLAIN/DESC parsing SQL statements
It's too complicated, it's complicated,
1+1=2 is simple, but only 1+1=2 is no food.
1+1=1 is complicated, and people who study 1+1=1 always have food.
The moderator's words are too abstruse ...
So insightful.
Version of the bishop taught me, how to optimize, I learn from you,