pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bendik Rognlien Johansen <bensmailinglists@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Large selects
Date: Thu, 24 Aug 2006 10:26:45 +0200
Message-ID: <1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com> (raw)

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

view thread (4+ messages)  latest in thread

Message-ID: <1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com>
Permalink:  ../1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com/
Also on:    postgresql.org/message-id/1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: bensmailinglists@gmail.com
  Subject: Re: Large selects
  In-Reply-To: <1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com>
  References: <1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox