SHOW_POOL_CACHE(1)

✨ SHOW_POOL_CACHE ✨

okay bestie, this is a pgpool-II 4.7.2 manual page and it's literally all about peeking at your query cache's stats πŸ’… lowkey iconic.


πŸ’– NAME πŸ’–

SHOW_POOL_CACHE β€” it shows you the cache storage statistics, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

SHOW POOL_CACHE

🌸 DESCRIPTION 🌸

So here's the vibe: SHOW POOL_CACHE displays in memory query cache statistics β€” but only if in memory query cache is enabled. That's the whole point fr fr.

Here's an example session, so you can see exactly what it's giving. And btw, See Table 28, β€œItems displayed in show pool_cache” for a description of each item πŸ‘‘

test=# \x
\x
Expanded display is on.
test=# show pool_cache;
show pool_cache;
-[ RECORD 1 ]---------------+---------
num_cache_hits              | 891703
num_selects                 | 99995
cache_hit_ratio             | 0.90
num_hash_entries            | 131072
used_hash_entries           | 99992
num_cache_entries           | 99992
used_cache_entries_size     | 12482600
free_cache_entries_size     | 54626264
fragment_cache_entries_size | 0
Note 🫢 If the cache storage is memcached, values for all columns except num_cache_hits, num_selects and cache_hit_ratio show 0. That's just how it is, diva.

🌈 Table 28. Items displayed in show pool_cache 🌈

Every single item, bestie, with zero skips:

  • num_cache_hits β€” The number of hits against the query cache. πŸ’–
  • num_selects β€” The number of SELECT that did not hit against the query cache.
  • cache_hit_ratio β€” The cache hit ratio. Calculated as num_cache_hits/(num_cache_hits+num_selects).
  • num_hash_entries β€” The number of entries in the hash table used to manage the cache. In order to manage large number of cache Pgpool-II uses the hash table. The number of hash entries is automatically adjusted to the nearest power of two greater than memqcache_max_num_cache. For example, 100,000, which is the default for memqcache_max_num_cache is adjusted to 131,072 (2 to the 17th power). math ate, honestly ✨
  • used_hash_entries β€” The number of used hash entries. If the value approaches num_hash_entries, it is recommended to increase num_hash_entries. Even if all the hash table entries are used, no error is raised. However, performance suffers because hash table entries and caches are reused to register new cache entries. 😭
  • num_cache_entries β€” The number of cache entries already used. In the current implementation the number should be identical to used_hash_entries.
  • free_cache_entries_size β€” The size in bytes of the unused cache. As this value approaches 0, it removes the registered cache and registers a new cache, which does not cause an error, but reduces performance. Consider to increase memqcache_total_size. not the performance dip bestie 😬
  • fragment_cache_entries_size β€” The size in bytes of the fragmented cache. When a registered cache is evicted, the space becomes fragmented until the next time that block is reused. Pgpool-II writes cache in fixed-size blocks specified by memqcache_cache_block_size. When a registered cache is evicted, the space becomes fragmented until the next time that block is reused. fragment_cache_entries_size displays the total size of such fragmented regions. (yes, the original said it twice and we are NOT gatekeeping, we're keeping both πŸ’€βœ¨)

aaaand that's the whole page! πŸŽ€ this was pgpool-II 4.7.2, dated 2023, and it's the SHOW POOL_CACHE(1) page β€” bye bestie, go check your cache stats πŸ’œπŸ¦‹

πŸ“¦ where this page comes from