I run the an update query on a table of 36 millions of lines. This request takes 45 minutes to run. processed field is indexed, and the database is on a ssd.
UPDATE batch_item SET processed=true
do you have a clue why this is so long?
I run the an update query on a table of 36 millions of lines. This request takes 45 minutes to run. processed field is indexed, and the database is on a ssd.
UPDATE batch_item SET processed=true
do you have a clue why this is so long?
I don't know how important your index is and whether 100% availability of it is crucial, but dropping the index, setting the value and adding the index back on at the end may save you time.
There's some useful information on bulk update operations here: https://www.codacy.com/blog/how-to-update-large-tables-in-postgresql/