Bug #112847 ResultSet.close for Large Tables with Slow Close Performance
Submitted: 26 Oct 2023 18:45 Modified: 5 Jul 2024 12:47
Reporter: Mohamed Kamarudeen S Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / J Severity:S5 (Performance)
Version: OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[26 Oct 2023 18:45] Mohamed Kamarudeen S
Description:
We have a table with millions of records, approximately 500GB in size. When we execute a SELECT query to retrieve a specific amount of data, the ResultSet.close method seems to wait until the entire result set is fully iterated through before closing. This significantly prolongs the closing process.

Ideally, we would like the ResultSet to perform the close operation without continuing to iterate through the remaining rows.

Is there a solution to resolve this issue?

Iterating the remaining fetched rows: https://github.com/mysql/mysql-connector-j/blob/7d6b0800528b6b25c68b52dc10d6c1c8429c100c/s...

How to repeat:
Steps to reproduce:

Load a table with approximately 800 million rows of data, resulting in a table size of approximately 500 GB.

Execute a SELECT query on the table using a Java application through JDBC.

Process 100,000 records from the result set.

Close the result set and the statement.
[5 Jun 2024 12:47] MySQL Verification Team
Hello Mohamed Kamarudeen,

Thank you for the bug report.
Please upgrade to latest version and report us back if issue persist even in latest version along with test case. Thank you.

Regards,
Ashwini Patil
[6 Jul 2024 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".