to update a single column for each of them? what’s the best approach doing this?
create 800k update statments and run them?
update table set active=1 where id in (select * from 800k_table)?
batch update
10k per run for example
COPY them to a temporary table and join it in UPDATE.
Will it be faster than use Update.... where id in (select ...)? How would the update look with such join?
Below you can find an example for update one table from another https://sqlize.online/sql/psql13/efa316b9de74485c1ce98979fa3ae04c/
>Will it be faster than use Update.... where id in (select ...)? I don't expect much difference. Both will be reasonably fast, anyway. >How would the update look with such join? This will depend on update and table structures.
original table is id+active , table list with 800k ids is only 1 column id.
UPDATE original SET active=now() FROM ids WHERE original.id=ids.id
Is it different then doing : update original set active =1 where id in (select id from ids) ??
Обсуждают сегодня