Search Postgresql Archives

Postgres and multiple updates in one statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there

 

We have a function which runs a set of update clauses and we are considering putting all the update clauses into one statement.

 

I would like to understand how postgres handles multiple updates. If we were to send 5 update statements in one sql statement to the db would it:

 

Do 5 passes on the table, on each pass, retrieve the id then update the row

 

Do 1 pass to retrieve the 5 primary keys, then update all rows in parallel

 

Apart from saving on the overhead of having to open up 5 separate connections, what are the benefits to passing in multiple updates in one statement?

 

Many thanks,

 

Jamie

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux