How long does it take to directly execute an update operation on 5 million records?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 500万数据更新操作可以直接执行需要多久

| username: 小于同学

How long does it take to directly execute an update operation on 5 million records?

| username: 像风一样的男子 | Original post link

Such a large volume of updates will generally cause an OOM (Out of Memory) error. It is recommended to split it into multiple executions.

| username: 濱崎悟空 | Original post link

It depends on the specific scenario. For this amount of data, it is recommended to execute in batches.

| username: zhaokede | Original post link

Split it up and update it in sections.

| username: Kongdom | Original post link

You can refer to this.

| username: FutureDB | Original post link

It is recommended to execute in batches rather than updating 5 million records at once, as the risk is too high.