[Pgpool-hackers] About query cache of pgpool-II

Huang Bambo bambo.huang at gmail.com
Wed Oct 12 03:14:11 UTC 2011


>> I mean is there anyone need to tell pgpool-II which table need to be
>> cached or not
>
> Yes, it's on my TODO list. However, there is a fundamental difficulty
> to implement it. For performance reason, to return cached result or
> not is decided *before* SQL parsing. Problem is, without SQL parsing
> it's not possible what tables are involved in the SELECT (think about
> complex JOIN or subquery).
>

> Delaying the decision after the parsing will add an overhead.

Can you tell me a little more detail about the implementation of the
cache function.
I guess the cache cached the result of a query. So I think just a
simple compare is
enough to check if this query is executed before. Maybe it may wast some memory
because sql is not case sensitive and maybe 2 sql actually is the same
while strcmp
tell us that they are not. If the result of sql is cached, just return
result. If not, do parse,
check if the the tables in white/black list and query data.

Bambo Huang


More information about the Pgpool-hackers mailing list