Batch insert logs query on every item
dstepanov opened this issue · comments
I was profiling R2DBC performance and noticed that the QUERY is logged X times for the batch statement instead of once. The logging is done on the subscribe. I wouldn't expect something to subscribe X times to produce results. Maybe there is a bug.
I have an example in micronaut-projects/micronaut-data#1847
Version 0.9.2.RELEASE
PostgeSQL doesn't have an execute batch command so this does not seem surprising to me
As @davecramer said, this is normal. The only way to reduce query count is concatenate queries (INSERT INTO … VALUES(<scalars>);INSERT INTO … VALUES(<scalars>);…
). Using combined statements does not support parameter binding though.