Lukas Eder points out that row-by-row updates are a great way of slowing down your system:
The best way to find out is to benchmark. I’m doing two benchmarks for this:
-
One that is run in PL/SQL, showing the performance difference between different approaches that are available to PL/SQL (namely looping, the
FORALL
syntax, and a single bulkUPDATE
) -
One that is run in Java, doing JDBC calls, showing the performance difference between different approaches available to Java (namely looping, caching
PreparedStatement
but still looping, batching, and a single bulkUPDATE
)
The results tend to be even more dramatic on SQL Server, where the row-by-row overhead is even greater.