X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 816B99FB29D for ; Thu, 24 Aug 2006 11:51:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 73010-06 for ; Thu, 24 Aug 2006 11:51:44 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by postgresql.org (Postfix) with ESMTP id 352B69FA6B1 for ; Thu, 24 Aug 2006 11:51:43 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so648392nfc for ; Thu, 24 Aug 2006 07:51:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=t+MT9WuQAsyq+vDk3ZOc9NLaUwDk2yG3NHr0T26bfCsfXVE92yqvhVA523zTOGm0yqgUe73GsnRpSQrFmbJ46amswQvgqAPFwFK8c+xioFqdv+xtPfnIUx4YBJ8xEDM0Y7FOX0R9P8dkHWyl0GWi6Dd9g/4ic5ehQFXQ+Mbrn+I= Received: by 10.49.91.6 with SMTP id t6mr3709057nfl; Thu, 24 Aug 2006 07:51:32 -0700 (PDT) Received: from ?10.80.1.40? ( [85.221.54.254]) by mx.gmail.com with ESMTP id m16sm4564630nfc.2006.08.24.07.51.31; Thu, 24 Aug 2006 07:51:32 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <44ED63AE.7080400@mosaic-ag.com> References: <1DE86526-D22F-483E-BA4A-DAF1B85EDFCC@gmail.com> <44ED63AE.7080400@mosaic-ag.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Bendik Rognlien Johansen Subject: Re: Large selects Date: Thu, 24 Aug 2006 16:52:52 +0200 To: pgsql-jdbc@postgresql.org X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.267 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/122 X-Sequence-Number: 15649 Thank you both! I will have a closer look tomorrow=01. On Aug 24, 2006, at 10:38 AM, Koth, Christian (DWBI) wrote: > > Bendik, > > - Loop through the results, building a Lucene index. > > I guess you are trying to search within the contact data and =20 > therefore using lucene? Why not using the database build in =20 > possibilities for searching using SQL? > > > - Does anyone have any suggestions on how to deal with this, other =20 > that throwing more hardware at the problem? Cursors? > > We are using cursors to access large result sets which works quite =20 > well. Also with postgres JDBC you can use scrollable result sets =20 > (only forward scrolling) and a limited fetch size. > > Christian > On Aug 24, 2006, at 10:30 AM, Roland Walter wrote: > Bendik Rognlien Johansen schrieb: >> 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 =20 >> (addresses) >> - Select phone numbers belonging to each person. By subselect or =20 >> join (contacts) >> - Loop through the results, building a Lucene index. >> >> >> Our tables: >> - people: ~ 8 million records (could be larger in the future, =20 >> 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, =20 >> storing it in memory, causing Java to run out of memory. =20 >> java.lang.OutOfMemoryError >> We have tried increasing memory for the program (-Xmn100M -Xms512M =20= >> -Xmx512M), but we only have one gigabyte of memory to work with. >> >> Does anyone have any suggestions on how to deal with this, other =20 >> that throwing more hardware at the problem? Cursors? >> >> >> Any help is much appreciated! >> Thanks >> > Look here: > > http://archives.postgresql.org/pgsql-jdbc/2006-01/msg00004.php > > --=20 > Roland Walter mailto: rwa (at) mosaic-ag (dot) com > MOSAIC SOFTWARE AG phone: +49 (0) 22 25 / 88 2-44 9 > Am Pannacker 3 fax: +49 (0) 22 25 / 88 2-20 1 > D-53340 Meckenheim http://www.mosaic-ag.com > > > Die in dieser E-Mail enthaltenen Nachrichten und Anhaenge sind =20 > ausschliesslich fuer den bezeichneten Adressaten bestimmt. Sie =20 > koennen rechtlich geschuetzte, vertrauliche Informationen =20 > enthalten. Falls Sie nicht der bezeichnete Empfaenger > oder zum Empfang dieser E-Mail nicht berechtigt sind, ist die =20 > Verwendung, > Vervielfaeltigung oder Weitergabe von Nachrichten und Anhaengen =20 > untersagt. > Falls Sie diese E-Mail irrtuemlich erhalten haben, informieren Sie =20 > bitte unverzueglich den Absender und vernichten Sie die E-Mail. > > This e-mail message and any attachment are intended exclusively for =20= > the named addressee. They may contain confidential information =20 > which may also be protected by professional secrecy. Unless you are =20= > the named addressee (or authorised to > receive for the addressee) you may not copy or use this message or =20 > any attachment > or disclose the contents to anyone else. If this e-mail was sent to =20= > you by mistake > please notify the sender immediately and delete this e-mail. >