Re: outOfMemoryError

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: "Vidas Makauskas" <vms(at)centras(dot)lt>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: outOfMemoryError
Date: 2006-08-29 16:59:59
Message-ID: DE16CA8B-FB61-429B-92B3-D859DA009E3D@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

This design is limited by memory.

You would be far better off inserting directly instead of using a
ResultSet

Dave
On 29-Aug-06, at 9:22 AM, Vidas Makauskas wrote:

>> Can you post your basic loop ?
>>
>
> ResultSet oracle = <"SELECT * FROM oracle">
> ResultSet postgres = <SELECT oid,* FROM postgres WHERE oid=0>
> ResultSetMetaData rsmd = postgres.getMetaData();
> int vnt = rsmd.getColumnCount();
> int rows = 0;
> while (oracle.next()) {
> <***** SEE BELLOW ******>
> postgres.moveToInsertRow();
> for (int i=1; i <= vnt; i++)
> if ( ! "oid".equals(rsmd.getColumnName(i)))
> if (oracle.getObject(rsmd.getColumnName(i)) != null)
> postgres.updateObject(i, oracle.getObject(rsmd.getColumnName(i)));
> postgres.insertRow();
> }
>
>> From what I can see your expectations are a little unrealistic
>> how do you
>> expect to process 10G rows at a time?
> rows += 1;
> if ( rows > 100000 ) {
> postgres = <SELECT oid,* FROM postgres WHERE oid=0>
> rsmd = postgres.getMetaData();
> rows = 0;
> }
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2006-08-29 20:10:12 Re: [HACKERS] [PATCHES] log_statement output for protocol
Previous Message Kris Jurka 2006-08-29 16:19:51 Re: I can't retrieve a scrollable ResultSet fr