3

it seems that the r2dbc-oracle doesnt have a proper back pressure implementation. If i select a bigger amoount of rows (say 10k) then it is way slower than a regular jdbc/JPA query. If i manually set the fetchsize to 1000 then the query is approx 8 times(!) faster.

so

  • can you confirm that back pressure is/is not implemented? if not: is that planned?
  • is there an easier way to set the fetchsize (maybe even global...) then using manual databaseclient.sql()-queries ?

1 Answers1

3

Thanks for sharing these findings.

I can confirm that request signals from a Subscriber do not affect the fetch size of Oracle R2DBC's Row Publisher. Currently, the only supported way to configure the fetch size is by calling io.r2dbc.spi.Statement.fetchSize(int).

This behavior can be attributed to Oracle JDBC's implementation of oracle.jdbc.OracleResultSet.publisherOracle(Function). The Oracle R2DBC Driver is using Oracle JDBC's Publisher to fetch rows from the database.

I can also confirm that the Oracle JDBC Team is aware of this issue, and is working on a fix. The fix will have the publisher use larger fetch sizes when demand from a subscriber exceeds the value configured with Statement.fetchSize(int).

Source: I wrote the code for Oracle R2DBC and Oracle JDBC's row publisher.

Michael McMahon
  • 166
  • 1
  • 5