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 D31579FB29D for ; Tue, 18 Jul 2006 14:04:11 -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 58337-01 for ; Tue, 18 Jul 2006 14:03:46 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from bay0-omc1-s36.bay0.hotmail.com (bay0-omc1-s36.bay0.hotmail.com [65.54.246.108]) by postgresql.org (Postfix) with ESMTP id BB8889FA61D for ; Tue, 18 Jul 2006 13:42:39 -0300 (ADT) Received: from hotmail.com ([64.4.56.38]) by bay0-omc1-s36.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 18 Jul 2006 09:42:38 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 18 Jul 2006 09:42:38 -0700 Message-ID: Received: from 64.4.56.200 by by101fd.bay101.hotmail.msn.com with HTTP; Tue, 18 Jul 2006 16:42:35 GMT X-Originating-IP: [193.128.230.172] X-Originating-Email: [jiebe@hotmail.com] X-Sender: jiebe@hotmail.com From: "jennie browne" To: pgsql-jdbc@postgresql.org Subject: Prepared Statement Memory Size Date: Tue, 18 Jul 2006 16:42:35 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 18 Jul 2006 16:42:38.0980 (UTC) FILETIME=[2E3F9C40:01C6AA89] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/62 X-Sequence-Number: 15488 We have a prepared statement example below: Query = SELECT consumer.consumer_id, consumer.address, consumer.operator_id FROM consumer INNER JOIN registration_list_consumer AS rlc ON (consumer.consumer_id = rlc.consumer_id AND rlc.registration_list_id = 15) INNER JOIN registration_list as rl on (rl.registration_list_id = rlc.registration_list_id AND rl.status_id = 25 ) WHERE consumer.address_type_id IN (1) AND NOT EXISTS (SELECT 'x' FROM target_run_transaction trt WHERE consumer.consumer_id = trt.consumer_id AND trt.target_run_id = 468) AND NOT EXISTS (SELECT 'x' FROM registration_list_consumer AS rlc_exclude, registration_list rl WHERE rlc_exclude.registration_list_id = rl.registration_list_id AND rlc_exclude.consumer_id = consumer.consumer_id AND rl.status_id = 25 AND rlc_exclude.registration_list_id in (34)) ORDER BY RANDOM() LIMIT 788 With no dynamic parameters populated during runtime…it will return roughly 1million rows. During execution of the query the preparedStatment grows in size up to 80MB and beyond. We have the fetchSize set to 1000 And autocommit set to false. And the following params set… stmt = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); can you suggest a work around to fix this problem…why is it taking up so much memory? Thanks, jennie