P
Patricia Shanahan
I'm using Java to query a MySQL database through com.mysql.jdbc.Driver.
My Java program calculates a relatively small summary of the query
result, and I'm sure my Java structure would fit in the default heap memory.
However, I run out of heap memory while running with -Xmx700m.
The program runs perfectly on a million line subset of the database, but
fails on the full database, over 88 million lines.
My query is:
String getData = "select count(*), "
+ "sum(net_amt), "
+ "exists(select * from stores where stores.store_id =
transactions.store_id) "
+ "from transactions group by txn_id;";
....
Statement st = con.createStatement();
ResultSet result = st.executeQuery(getData);
There are about 10,160,053 distinct values of txn_id.
Any ideas for what I may be doing wrong? Suggestions for how to obtain
and scan a large query result without Java heap problems?
Thanks,
Patricia
My Java program calculates a relatively small summary of the query
result, and I'm sure my Java structure would fit in the default heap memory.
However, I run out of heap memory while running with -Xmx700m.
The program runs perfectly on a million line subset of the database, but
fails on the full database, over 88 million lines.
My query is:
String getData = "select count(*), "
+ "sum(net_amt), "
+ "exists(select * from stores where stores.store_id =
transactions.store_id) "
+ "from transactions group by txn_id;";
....
Statement st = con.createStatement();
ResultSet result = st.executeQuery(getData);
There are about 10,160,053 distinct values of txn_id.
Any ideas for what I may be doing wrong? Suggestions for how to obtain
and scan a large query result without Java heap problems?
Thanks,
Patricia