Skip to content
Advertisement

Run UPDATE query while the INSERTs are running

I have a DB table which size is around 100,000 rows. I Need to run an UPDATE query on that table (affecting every row) which runs for approximately 25 minutes. During this 25 minutes, there will be approximately 300 INSERTs to the same table.

I’m wondering whether those INSERTs will run? Will they be blocked for the time the UPDATE is running, and then executed, or will they just never be executed?

I’m using Postgres database.

Advertisement

Answer

Yes, those inserts will run.

An UPDATE, even when changing all rows, does not block the INSERTs

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement