update log_cnc_exportip_0517 set country = tb_ipaddress.country from tb_ipaddress where log_cnc_exportip_0517.ipnum between tb_ipaddress.ip1 and tb_ipaddress.ip2这里的log_cnc_exportip_0517.ipnum匹配条件是between tb_ipaddress.ip1 and tb_ipaddress.ip2 我觉得可能是这里的问题,log_cnc_exportip_0517表中的每条记录的ipnum的使用between tb_ipaddress.ip1 and tb_ipaddress.ip2的条件是不是在tb_ipaddress里面有不止一条记录? 这样的话可能就对了。
suifix() ( ) update log_cnc_exportip_0517 set country = tb_ipaddress.country from tb_ipaddress where log_cnc_exportip_0517.ipnum between tb_ipaddress.ip1 and tb_ipaddress.ip2这里的log_cnc_exportip_0517.ipnum匹配条件是between tb_ipaddress.ip1 and tb_ipaddress.ip2 我觉得可能是这里的问题,log_cnc_exportip_0517表中的每条记录的ipnum的使用between tb_ipaddress.ip1 and tb_ipaddress.ip2的条件是不是在tb_ipaddress里面有不止一条记录? 这样的话可能就对了。 --------------------------------------------------------------- 同意.
suifix() ( ) 信誉:100 Blog 加为好友 2007-5-17 12:28:14 得分: 0
我觉得可能是这里的问题,log_cnc_exportip_0517表中的每条记录的ipnum的使用between tb_ipaddress.ip1 and tb_ipaddress.ip2的条件是不是在tb_ipaddress里面有不止一条记录?
这样的话可能就对了。
你得到的执行时间是在程序中 算出的
还是在sql算出的.
就算是有差别也不会这么大~~
1。log_cnc_exportip_0517中的每一条记录的ipnum 在tb_ipaddress只能找到1条满足between(ip1,ip2)的纪录吗?2。tb_ipaddress表中的字段很多或者每条记录的字节数较大?建议索引中增加country字段不是你的问题没人回答,你因为涉及性能调优,有很多细节需要了解的,比如第二条建议如果你做了,我想就马上会好些
我觉得可能是这里的问题,log_cnc_exportip_0517表中的每条记录的ipnum的使用between tb_ipaddress.ip1 and tb_ipaddress.ip2的条件是不是在tb_ipaddress里面有不止一条记录?
这样的话可能就对了。
---------------------------------------------------------------
同意.
1。贴上index啊
2。填充因子一样?
3。一张表经常用的?执行操作的时候是不是有并发用户?
4。数据库日至是否在作第二个表的时候满了?而且日至开得很大?
......填充因子这一观点很重要,填充因子越小,插入的速度就快,但查询速度就慢。
如,当填充因子的值为50%,那么数据库的读取性能会降低2倍。