我有下表名为business_extra
business_id address neighbourhood ========================================== 1 2 3 .. 400 000 records
address
列包含空值,因此我想使用另一个表
我写了以下查询:
update b2g_mns_v2.txn_business_extra a
set mappable_address=b.mappable_address
from b2g_mns_v2.temp_business b
where b.import_reference_id=a.import_reference_id
但收到错误消息:
超出共享内存
答案 0 :(得分:1)
update b2g_mns_v2.txn_business_extra a
set mappable_address=b.mappable_address
from b2g_mns_v2.temp_business b
where b.import_reference_id=a.import_reference_id
and a.mappable_address is null
limit 10000
这样做几次(10000批次)。 正如提到的a_horse_with_no_name,通过提供执行计划,可以更好地确保查询正常。