-
Notifications
You must be signed in to change notification settings - Fork 43
OracleR2dbcOptions doesn't support defaultRowPrefetch #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
All R2DBC drivers, including Oracle, support The trade-off is memory usage. Oracle R2DBC passes the value of But if we're fetching just 1 row, and we set the same fetch size of 5000, now we'll be wasting a lot of memory. Of course, the database is only sending 1 row of data, so it's not as if we're storing 5000 rows of data in memory. However, Oracle JDBC will still be allocating several arrays to store metadata for each column, and these arrays are going sized at 5000. If we're fetching just 1 row, these arrays really could have been sized at 1, so we've wasted a lot of memory in this situation. This is just for your consideration: You can consider the trade-off between performance and memory usage. If you think a connection property is the right way to go, there are some ways to do that:
I hope this is helpful. Please let me know. |
Thanks Michael, really appreciate your kind explanation, I decided to set Fetch size at statement level now, since I'm using Spring R2dbcEntityTemplate, code looks this way: Also I've tried set JVM system property with but in connection properties due to I'm using Spring boot R2dbc connection url in yaml: spring:
r2dbc:
url: r2dbc:oracle://host:port?oracle.jdbc.defaultRowPrefetch=5000 seems it's not working. I've checked but no idea where this |
Oracle R2DBC only supports a subset of the Oracle JDBC connection properties. (There's a list here). We can add support for defaultRowPrefetch, it just takes a tiny bit of code. You're welcome to create a PR for the change if you want to, otherwise I'll get to it fairly soon. The changes should be similar to this PR: |
It seems 1.2 Oracle r2dbc doesn't support defaultRowPrefetch ConnectionPropety
here's the issue:
Oracle version: 19c
spring boot r2dbc 3.2.5
I have a table (80k rows ), select all data using R2dbcTemplate which needs nearly 63 seconds, on DB visualizer Tool after set JDBC Fetch size to 5000, it only needs 0.6s, As far as I know, JDBC fetch Size is defaultRowPrefetch in Oracle, but seems it's not supported yet, please advise how to set it.
The text was updated successfully, but these errors were encountered: