我用postgresql (v9.5)configuration了pgpool2 (v3.4.3)来caching这样的查询:
memory_cache_enabled = on memqcache_method = 'shmem' memqcache_total_size = 67108864 memqcache_max_num_cache = 10000000 memqcache_expire = 600 memqcache_auto_cache_invalidation = on memqcache_maxcache = 409600 memqcache_cache_block_size = 1048576 memqcache_oiddir = '/var/log/pgpool/oiddir'
我可以确认查询实际上是被caching的。
问题在于即使在更新,插入和删除同一张表之后,caching也不会失效。 这是发生了什么事情:
高速caching失效在public架构中按预期工作,但不在其他架构中工作。 我已经阅读了常见问题解答 :
当我使用模式限定的表名时,pgpool-II不会在内存查询caching上失效,并且我得到了过时的数据。 为什么? 看来你没有安装“pgpool_regclass”函数。 没有这个函数,pgpool-II将忽略模式限定表名的模式名称pat,并且高速caching失效失败。
我已经在application和postgres数据库上同时安装了pgpool_adm , pgpool_recovery和pgpool_regclass扩展,但caching仍然无效。