X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id B50A09FB3E3 for ; Thu, 24 Aug 2006 05:25:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 69831-08 for ; Thu, 24 Aug 2006 08:25:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id 1EE6F9FB28A for ; Thu, 24 Aug 2006 05:25:25 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id o60so589279nfa for ; Thu, 24 Aug 2006 01:25:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=qnqhdRHY8cf7wJkOOToDvP3/QbYDjvJN2WkDoHhkkEF6Ovhp0DPdEmnrYrd+lZSVoksaFBLG0Uxv745qo4L1hR4cI1KtfcvF67kh/FEdc35bgYnBErPYN/Lw+OgiWCXr+cVQGzgcSbkqhRkWNRgRlWYqDxN05QRkSIHnXGpiBE4= Received: by 10.48.48.18 with SMTP id v18mr3190284nfv; Thu, 24 Aug 2006 01:25:24 -0700 (PDT) Received: from ?10.80.1.40? ( [85.221.54.254]) by mx.gmail.com with ESMTP id p20sm3956739nfc.2006.08.24.01.25.23; Thu, 24 Aug 2006 01:25:23 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.2) To: pgsql-jdbc@postgresql.org Message-Id: <1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-4--140337607 From: Bendik Rognlien Johansen Subject: Large selects Date: Thu, 24 Aug 2006 10:26:45 +0200 X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 tests=HTML_50_60, HTML_MESSAGE, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: *** X-Archive-Number: 200608/118 X-Sequence-Number: 15645 --Apple-Mail-4--140337607 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello! We are having a lot of trouble trying to use JDBC with PostgreSQL. This is what we want to achieve: - Select all rows in a table (people) - Select addresses belonging to each person. By subselect or join (addresses) - Select phone numbers belonging to each person. By subselect or join (contacts) - Loop through the results, building a Lucene index. Our tables: - people: ~ 8 million records (could be larger in the future, maybe 50 million) - addresses ~8 million records - contacts: ~10 million records Hardware: 2x dual core 3GHz intel Xeon 1-2 Gb RAM Problem: It seems that the PostgreSQL driver fetches the whole result, storing it in memory, causing Java to run out of memory. java.lang.OutOfMemoryError We have tried increasing memory for the program (-Xmn100M -Xms512M - Xmx512M), but we only have one gigabyte of memory to work with. Does anyone have any suggestions on how to deal with this, other that throwing more hardware at the problem? Cursors? Any help is much appreciated! Thanks --Apple-Mail-4--140337607 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 Hello!

We are having a lot of = trouble trying to use JDBC with PostgreSQL.

This is what we want to = achieve:

- = Select all rows in a table (people)
- Select addresses = belonging to each person. By subselect or join (addresses)
- = Select phone numbers belonging to each person. By subselect or join = (contacts)
- Loop through the results, building a Lucene = index.


Our tables:
- = people: ~ 8 million records (could be larger in the future, maybe 50 = million)
- addresses ~8 million records
- contacts: = ~10 million records


Hardware:
2x dual = core 3GHz intel=A0Xeon
1-2 Gb RAM



Problem:

It seems that the = PostgreSQL driver fetches the whole result, storing it in memory, = causing Java to run out of = memory.=A0java.lang.OutOfMemoryError
We have tried increasing = memory for the program (-Xmn100M -Xms512M -Xmx512M), but we only have one = gigabyte of memory to work with.

Does anyone have any = suggestions on how to deal with this, other that throwing more hardware = at the problem? Cursors?


Any help is = much=A0appreciated!
Thanks




= --Apple-Mail-4--140337607--