预计在db2中更新500万条记录的时间

时间:2012-11-26 16:49:14

标签: performance db2 sql-update

I have table Customer_address_tx having structure below..

cust_id_pk      BIGINT
comm_fk         BIGINT

Now I want to update comm_fk with null where comm_fk is zero, Such records lies in range 280000000 to 320000000(cust_id_pk)

在上述范围内,有500万条这样的记录,其中comm_fk = 0,我想用null更新

My Update query

db2“更新Customer_address_tx set comm_fk = null其中comm_fk = 0”

为了有效地运行上述查询,我​​将上述更新语句分解为多个更新语句,范围为280000000到320000000(cust_id_pk),每个 5000

db2“更新Customer_address_tx set comm_fk = null其中comm_fk = 0且cust_id_pk介于280000000和280005000之间”

db2“更新Customer_address_tx set comm_fk = null其中comm_fk = 0且cust_id_pk介于280005001和280010000之间”

即可。 。 。

是正确的方法..?

欢迎任何其他方法......

0 个答案:

没有答案