Optimal size for readbuffer

Johan R

Member
In one of our queries we changed the readbuffer to a higher number (in stead of 25 we set it to 1000). After this change the data is retrieved from the database a lot faster. Depending on the number of fields which is requested from the database... is there an optimal size for the readbuffer value?

For example: is it better to get 15 Kb of data per fetch or is it better (faster) to get 100kb per fetch? And is there a maximum? Or depends this on de bandwidth of the netwerk (which varies from 2 mb/s until 100mb/sec).
 
The ReadBuffer property controls the number of records transferred in one network roundtrip. It's a trade off between memory usage and network roundtrips. The optimal value depends on may things:
  • The network speed. On a fast network there is little overhead from network rountrips, so this property will not have much effect.
  • The query speed. If the query is slow on the server, there is again little overhead from network rountrips, and this property will not have much effect.
  • The query size. If the query returns 100 rows on average, then setting the ReadBuffer to 1000 does not make much sense and will only cost memory.
 
Back
Top