python - 数据库大量数据update慢,如何克服?
大家讲道理
大家讲道理 2017-04-18 10:00:00
0
1
390
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
迷茫

This is a good question. If you answer it carefully, you can write a lot. However, since the amount of information given in the question is too small, it will not be divergent.

First of all, each update is 100ms. Have you checked where the bottleneck of DB is? Is the disk slow? Or not enough memory? It is difficult to solve the problem by guessing without knowing the bottleneck.

Secondly, I think your ID must be indexed, otherwise it should be slower. Then a simple improvement is that instead of each update being a Transaction, try saving hundreds or thousands of updates and submitting them at once.

Then, I guess you have optimized the PG configuration. If not, look for information on this and give it a try.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template