A IP dictionary list, about 45 w interval period, table structure for IP (ip_min_index ip_max_index, description)
A IP access list, every day is about 1.5 W IP access, table structure for access (ip_index, description)
Requirements:
According to the access. Ip_index's IP. Ip_min_index, IP. Ip_max_index interval, the IP. The description of the update to access. The description
The current SQL:
Update the access a
The set a. d. escription=(
Select the description from IP b where b.i p_min_index & lt;=Anderson p_index and Anderson p_index & lt;=b.i p_min_index
)
Where a. d. escription is null;
The problems of the:
In small-scale test cases, update the time-consuming also can accept, but tens of thousands of level is not line, now turn to what more optimization algorithm/train of thought,,,
CodePudding user response:
You wrote two ip_min_index to SQL statements, one of them should be ip_max_index,Do you have how much data access list? What do you do in your update time without time conditions? Such as update nearly 48 hours at a time?
You use left join a try,
CodePudding user response: