[CONJ-26] [Feature Request] Implement configurable fetch size and fetch direction for Statement/ResultSet Created: 2013-02-14 Updated: 2016-04-04 Resolved: 2016-04-04 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.1.0 |
| Fix Version/s: | 1.4.0 |
| Type: | Epic | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Epic Name: | Implement multiple row fetching | ||||||||||||||||||||||||
| Sprint: | Sprint connector/j 1.3.0 | ||||||||||||||||||||||||
| Description |
|
As discussed earlier, currently fetch size is "one or all". It would be good to implement it fully. |
| Comments |
| Comment by Vladislav Vaintroub [ 2013-04-28 ] |
|
I think fetch direction can safely be ignored. after looking again at spec. this is a hint to the driver, which has no visible effects during runtime (i.e ResultSet.next() will still move forward, and previous() will move backward). We cannot use this hint - to move backwards with ResultSet.previous(), we have to read and cache the whole result, no way around it. |
| Comment by Paolo Bazzi [ 2016-02-24 ] |
|
+1 for solving this issue.... |
| Comment by Diego Dupin [ 2016-02-24 ] |
|
Some good news Paolo : that's in the roadmap for next version 1.4.0. |
| Comment by Vladislav Vaintroub [ 2016-02-24 ] |
|
bazzip ,alas, is no principal difference between streamed mode and configurable fetch size. streaming mode requires least memory though |
| Comment by Paolo Bazzi [ 2016-02-24 ] |
|
@Diego very nice to hear! @Vladislav
|
| Comment by Vladislav Vaintroub [ 2016-02-24 ] |
|
I agree on portability, but I doubt you will gain any performance the driver does exactly the same amount of network reads, and the server the same amount of writes. |
| Comment by Diego Dupin [ 2016-04-04 ] |
|
This is now implemented on version 1.4.0. Like Vladislav say, since all datas have to be read, performance doesn't change a lot, JMH results (source https://codeshare.io/OlBRO) when streaming 100,000 rows Bench.fetchSizeBy1000 : 50.274 ± 0.206 ms/op (read with fetch size 1000) No big difference, but avoiding to create a big buffer permit to gain a small 1%, ( and avoid loading all in memory) |