Re: ResultSet memory usage
От | Barry Lind |
---|---|
Тема | Re: ResultSet memory usage |
Дата | |
Msg-id | 3C3F2634.5030708@xythos.com обсуждение исходный текст |
Ответ на | Re: ResultSet memory usage ("Dave Cramer" <Dave@micro-automation.net>) |
Список | pgsql-jdbc |
> Couldn't that still be implemented in the JDBC driver by reading from > the socket a little at a time? Or would that introduce bigger problems, > like catastrophic slowdown of other connections to the backend? It can't. Consider the following example: ResultSet l_rset1 = l_stmt1.executeQuery("select a from foo"); while (l_rset1.next()) { ResultSet l_rset2 = l_stmt2.executeQuery("select b from bar where a = " + l_rset1.getInt(1)); while (l_rset2.next()) { //do something useful } } This example shows that you need to be able to use the socket to execute other queries while you are still fetching from the first. Doing what you suggest would break many applications that use jdbc. thanks, --Barry Timo Savola wrote: >>Unfortunately this is an artifact of the way the backend works, once the >>request is made the backend is going to give us all the data. >> > > Couldn't that still be implemented in the JDBC driver by reading from > the socket a little at a time? Or would that introduce bigger problems, > like catastrophic slowdown of other connections to the backend? > > Timo > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >
В списке pgsql-jdbc по дате отправления: