Subject | Re: [firebird-support] Firebird Prepared Queries |
---|---|
Author | Ann W. Harrison |
Post date | 2010-02-08T16:30:06Z |
ruan_h wrote:
someone will correct me, but here are some answers.
not a significant amount of memory on a modern machine. The
space is from the connection's memory, not from the server
page cache.
There is no one optimum number of queries to cache. If
the query will be reused, it should be cached, If it's
generated on the fly, it should not be cached.
a handle to the prepared query.
it. Firebird does not have a shared query cache between
connections and assumes that a connection will know which
queries it has prepared.
Cheers,
Ann
>My information may be slightly out of date, in which case
someone will correct me, but here are some answers.
>Prepared queries do take up some amount of memory. Probably
> 1. What's the effect of having too many prepared queries in
> each connection? Does Firebird have an optimum number of
> prepared queries kept in cache?
not a significant amount of memory on a modern machine. The
space is from the connection's memory, not from the server
page cache.
There is no one optimum number of queries to cache. If
the query will be reused, it should be cached, If it's
generated on the fly, it should not be cached.
> 2. Does Firebird ever unprepare some queries when thereFirebird never unprepares a query if a connection holds
> are too many or does it only do this when clients ask i
> t to? If it's the former, what happens to the handles that
> clients hold to the prepared queries?
a handle to the prepared query.
> 3. If I have an SQL already prepared and I ask forNo, or at least not when I was paying close attention to
> prepare the same SQL again, will Firebird return the
> already prepared one or prepare it again?
it. Firebird does not have a shared query cache between
connections and assumes that a connection will know which
queries it has prepared.
Cheers,
Ann