[postgis-users] JDBC OutofMemoryError

Akira Komo forreg at mail.com
Thu Aug 4 10:26:19 PDT 2005


Mark,

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().  

Best Regards

-- Akiro

  ----- Original Message -----
  From: "Mark Cave-Ayland"
  To: "'PostGIS Users Discussion'"
  Subject: RE: [postgis-users] JDBC OutofMemoryError
  Date: Thu, 4 Aug 2005 10:09:44 +0100

Hi Akiro, 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. What exactly are you trying to find out from
your two data tables? Kind regards, Mark.

------------------------
WebBased Ltd
17 Research Way
Tamar Science Park
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023
W: http://www.webbased.co.uk

  -----Original Message-----
  From: postgis-users-bounces at postgis.refractions.net
  [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
  Akira Komo
  Sent: 03 August 2005 21:28
  To: postgis-users at postgis.refractions.net
  Subject: [postgis-users] JDBC OutofMemoryError

  Dear all,  

  I have two small tables arizona_geo and colorado_geo in PostGIS

  which were converted from two shapefiles. Each of them has only

  several hundreds records. When I tried to issue a very simple
  query via

  JDBC connection, I always got an  OutOfMemoryError. One example

  query is

  select 1 from arizona_geo X, colorado_geo Y

   I tried different postgresql JDBC driver with postgis extension,
  basically

   I got the same error. I am very appreciated if somebody can give me
  an

  idea to solve this problem.

  -- Kumo


  --

  ___________________________________________________________
  Sign-up for Ads Free at Mail.com
  http://www.mail.com/?sr=signup


>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/postgis-users/attachments/20050804/954c84ee/attachment.html