[pgpool-general: 8399] Re: Extended query and cache

Tatsuo Ishii ishii at sraoss.co.jp
Wed Sep 14 08:42:25 JST 2022


> Hi,
> 
> In case query already cached, why in extended query mode the db knows about
> that query?
> Because in that case pgpool should return the result from the cache in
> order to save db resources.
> But I found that although we have the query in cache pgpool still send
> parse and bind request to the db.
> 
> Please share your thoughts 🙏

Yes, Pgpool-II only caches the result of execute message. The main
reason is, to not return stale cache.  After receiving a close message
for the statement or the portal that is bound to the execute message,
the cache for the execute message should not be returned. When
Pgpool-II receives close messages, they remove the internal record of
previpusly received statement or portal. When an execute message
arrives, Pgpool-II checks whether the record for the execute message
exists. If does not, the request fails. This strategy is simple but
works well.

I think the saving by caching parse message is not small for
especially complex queries. But in this case users already reuse the
prepared statement anyway.

I think the saving of bind message is usually small because it does
not involve planning in most cases.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list