Tim Zhukov-Khovanskiy
Tim Zhukov-Khovanskiy

Reputation: 500

JDBC Large Fetch Size and Small Result Set performance

Oracle JDBC default fetch size is at 10, and I see a performance increase in using fetch size 100 for particular queries with large number of results.

I'm wondering if setting fetch size to 100 across the board on the connector would impact the performance of the queries with small result sets (i.e. 1 or few rows) negatively.

Upvotes: 1

Views: 1480

Answers (1)

Yuri
Yuri

Reputation: 1814

Yes, you are correct that the default fetchSize is set to 10. Before tuning this parameter I could recommend you to profile for some time. After profiling, you could set the global settings. For the most cases, developers tend to set it to 100.

I think that you could set global fetch size for the whole project and then, if needed, you could overwrite it for some individual queries where it should be greater/lesser.

Upvotes: 2

Related Questions