Open kalaiyarasiganeshalingam opened 1 year ago
Can't we have the batchSize as client configuration?
We can do it. But, the same count of data may have different sizes(storage). It depends on the data type and values. Batch size depends on the size of the data. So, if we configure it as a client configuration, we can't change it according to the data size.
There are two use cases we need to consider,
User wants to use the same batch size for all batchExecute
calls within the application.
User wants to have different batch sizes of each batchExecute
call within the application.
both are valid cases. @kalaiyarasiganeshalingam can you check how the spring framework handles if we didn't specify the batch size? are they going with a default hard-coded batch size or getting from another place like config?
According to the Spring framework[1][2], the block size is configured on the method call. If batchUpdate() is called without a batch size, the batch size is the length of batchArgs. [1] https://docs.spring.io/spring-framework/docs/3.0.0.M4/reference/html/ch12s04.html [2] https://mkyong.com/spring/spring-jdbctemplate-batchupdate-example/
Summary
The existing API for batch execution doesn't have a way to execute multiple batches by dividing the input query with a given size. This will cause memory limitation issues when executing very large data. So, this proposal proposes an API to execute the batch queries into multiple batches of queries.
Goals
Motivation
As mentioned in the summary, the existing API may produce memory limitation issues and doesn't have a way to avoid this issue. This issue can be overcome by splitting the queries into multiple batches with the batch size. The motivation is to avoid memory limitation issues when executing the batch data.
Description
API Definition: