Home > database >  Description: the interval optimization algorithm of hit after the update
Description: the interval optimization algorithm of hit after the update

Time:09-28

Existing:
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:

reference 1st floor feiazifeiazi response:
you wrote SQL statements 2 ip_min_index, one 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,


1, Anderson p_index & lt;=b.i p_min_index this is really is I dialed the wrong number,
2, access (ip_index, description) only IP when put in storage, all don't tell time, only judge a. d. escription is null to
3, the access table 1.5 W
4, left the join tried and still slowly slowly
  • Related