From: jennie browne <jiebe@hotmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Prepared Statement Memory Size
Date: Tue, 18 Jul 2006 16:42:35 +0000
Message-ID: <BAY101-F2820CC730656C794594375AE630@phx.gbl> (raw)
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
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: jiebe@hotmail.com
Subject: Re: Prepared Statement Memory Size
In-Reply-To: <BAY101-F2820CC730656C794594375AE630@phx.gbl>
References: <BAY101-F2820CC730656C794594375AE630@phx.gbl>
* 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