On Sat, 2004-01-17 at 17:04, Nicholas wrote:
> What is a good estimation model for determining the
> prepared statement cache size ? 
> 
> About how much memory (or other overhead
> considerations) would anyone estimate a cached
> prepared statement will consume ?

One thing you need to remember is that prepared
statements are cached per connection. The more
connections you have, the more prepared statements
you get (even when they are the same query).

But it depends upon the db, jdbc driver
and your queries.

If you hold a prepared statement open, you are
asking the db to precompile an access plan
to handle the query. 

Some dbs might even create a temporary index.
On others it might do little more than parse
and validate the query.

You avoid some parsing/metadata lookups because
they are stored in the prepared statement.
This can use memory within jboss, but it depends
on the jdbc driver.
This can be a common source of memory leaks so
check your driver provider for patches.

Also remember the prepared statement is not closed.
You have to explicity close result sets yourself,
something that is normally done at statement close.

I can't give any more advice other than measure it,
don't forget to analysis the impact on your db.
Theory must always be validated by experiment.

Regards,
Adrian

> 
> Thanks.
> 
> //Nicholas
> 
> =====
> Nicholas Whitehead
> Home: (973) 377 9335
> Cell: (201) 615 2716
> [EMAIL PROTECTED]
> Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to