-
Notifications
You must be signed in to change notification settings - Fork 113
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
Feature: Load data in slices(pagination under hood) #77
Comments
It sounds like there are many ways to achieve this already using existing RxJava operators. |
if you run a sql query it does request all the data at once and then transform to rx. |
Sounds like you are talking about https://github.com/davidmoten/rxjava-jdbc#fetch-size. If you don't set fetchSize then your jdbc driver will use its default (which can be quite small; for Oracle is 10!) so you are unlikely to run out of memory but if you are fetching a lot of records you will make fewer calls to the db by setting fetchSize to a larger value. |
Cool. Somehow I've missed that from documentation. |
@CyborTronik @stanisfun pay attention that currently fetchsize cannot be set to Integer.MIN_VALUE, which is critical for getting query result as a stream, at least on MySQL. |
I assume that @CyborTronik means an alternative of JdbcCursorItemReader (from spring batch). This really makes sense, because consumer can work significantly slowly, then producer. And pauses between fetching new data can be more than connection timeout, and you will get an exception. Cursor reader will fix this problem, but it's not easy to implement, because of different DBs has a different syntax (approach) for pagination. |
Considering the fact this library has to be used in Rx architecture, there comes the need to load and process data in slices (pagination).
Lets say you have to process a million of records so you cannot handle all this stuff just using one 'select' operation. You have to load data in bits and process just few rows at time and then load next few rows and process ...
The text was updated successfully, but these errors were encountered: