<P>Mark,</P>
<P>Thank you so much for your replying. The real query would be more complicated with some join condition. I&nbsp;suspect the problem was from postgresql JDBC driver. You know a JDBC driver has a buffer at client side, it&nbsp;should not&nbsp;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&nbsp;dynamically when end users go through the ResultSet&nbsp;by calling ResultSet.next(). In my case, probably at very beginning, only&nbsp;serveral hundreds&nbsp;records were downloaded to the JDBC client side. Notice that every record is 1. The&nbsp;OutOfMemoryError occured&nbsp;just after executing the statement.executeQuery()&nbsp;before I&nbsp;call Result.next().&nbsp;&nbsp;</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>&nbsp;</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&nbsp;size of the resulting data set will be equal to&nbsp;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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</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,&nbsp;&nbsp;</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&nbsp;a very simple query&nbsp;via</P>
<P>JDBC connection, I always got an &nbsp;OutOfMemoryError. One example</P>
<P>query is </P>
<P>&nbsp;&nbsp;&nbsp; select 1 from arizona_geo X, colorado_geo Y</P>
<P>&nbsp;I tried different postgresql JDBC driver with postgis extension, basically</P>
<P>&nbsp;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>&nbsp;</P>
<P>&nbsp;</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>&gt;<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; postgis-users mailing list<BR>&gt; postgis-users@postgis.refractions.net<BR>&gt; 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>