<P>Mark,</P>
<P>Thank you so much for your replying. The real query would be more complicated with some join condition. I suspect the problem was from postgresql JDBC driver. You know a JDBC driver has a buffer at client side, it should not fetch all the records from the server side after issuing a query, otherwise you are not able to query a database with million records. It should load the records dynamically when end users go through the ResultSet by calling ResultSet.next(). In my case, probably at very beginning, only serveral hundreds records were downloaded to the JDBC client side. Notice that every record is 1. The OutOfMemoryError occured just after executing the statement.executeQuery() before I call Result.next().  </P>
<P>Best Regards</P>
<P>-- Akiro<BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">----- Original Message -----<BR>From: "Mark Cave-Ayland" <M.CAVE-AYLAND@WEBBASED.CO.UK><BR>To: "'PostGIS Users Discussion'" <POSTGIS-USERS@POSTGIS.REFRACTIONS.NET><BR>Subject: RE: [postgis-users] JDBC OutofMemoryError<BR>Date: Thu, 4 Aug 2005 10:09:44 +0100<BR><BR>
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2>Hi Akiro,</FONT></SPAN></DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2>When you do "select 1 from arizona_geo X, colorado_geo Y" you are actually calculating the cross-product of the two data sets, and so the size of the resulting data set will be equal to number of rows in arizona_geo * number of rows in colorado_geo, which is probably why you are running out of memory.</FONT></SPAN></DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2>What exactly are you trying to find out from your two data tables?</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2>Kind regards,</FONT></SPAN></DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=596210609-04082005><FONT face=Arial color=#0000ff size=2>Mark.</FONT></SPAN></DIV><!-- Converted from text/plain format -->
<P><FONT size=2>------------------------<BR>WebBased Ltd<BR>17 Research Way<BR>Tamar Science Park<BR>Plymouth<BR>PL6 8BT<BR><BR>T: +44 (0)1752 797131<BR>F: +44 (0)1752 791023<BR>W: <A href="http://www.webbased.co.uk/">http://www.webbased.co.uk</A><BR> </FONT> </P>
<BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> postgis-users-bounces@postgis.refractions.net [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Akira Komo<BR><B>Sent:</B> 03 August 2005 21:28<BR><B>To:</B> postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] JDBC OutofMemoryError<BR><BR></FONT></DIV>
<P>Dear all,  </P>
<P>I have two small tables arizona_geo and colorado_geo in PostGIS </P>
<P>which were converted from two shapefiles. Each of them has only </P>
<P>several hundreds records. When I tried to issue a very simple query via</P>
<P>JDBC connection, I always got an  OutOfMemoryError. One example</P>
<P>query is </P>
<P>    select 1 from arizona_geo X, colorado_geo Y</P>
<P> I tried different postgresql JDBC driver with postgis extension, basically</P>
<P> I got the same error. I am very appreciated if somebody can give me an </P>
<P>idea to solve this problem.</P>
<P>-- Kumo</P>
<P> </P>
<P> </P><BR>-- 
<P>___________________________________________________________<BR>Sign-up for Ads Free at Mail.com<BR><A href="http://mail01.mail.com/scripts/payment/adtracking.cgi?bannercode=adsfreejump01" target=_blank>http://www.mail.com/?sr=signup</A></P></BLOCKQUOTE><BR>><BR>> <BR>> _______________________________________________<BR>> postgis-users mailing list<BR>> postgis-users@postgis.refractions.net<BR>> http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE><BR>

-- 
<p>___________________________________________________________<br>Sign-up for Ads Free at Mail.com<br>
<a href="http://mail01.mail.com/scripts/payment/adtracking.cgi?bannercode=adsfreejump01" target="_blank">http://www.mail.com/?sr=signup</a></p>