db chunk reading/aggregation in a separate thread #1015
fixed tests #1015