Add comment to query cache module header file.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 5 Jan 2023 07:50:43 +0000 (16:50 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 9 Jan 2023 00:52:48 +0000 (09:52 +0900)
Some struct size added to explain required shared memory size.

src/include/query_cache/pool_memqcache.h

index 3129ef8a91703cc8de39e67e16c1bc3f587ef880..73d301114c85aaf75c3a5b5d0cd0d87dad1c444a 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2019     PgPool Global Development Group
+ * Copyright (c) 2003-2023     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -59,6 +59,9 @@ typedef struct
 
 #define POOL_BLOCK_USED        0x0001  /* is this block used? */
 
+/*
+ * Cache block header (12 bytes)
+ */
 typedef struct
 {
        unsigned char flags;            /* flags. see above */
@@ -75,6 +78,9 @@ typedef struct
 #define POOL_ITEM_HAS_NEXT     0x0002  /* is this item has "next" item? */
 #define POOL_ITEM_DELETED      0x0004  /* is this item deleted? */
 
+/*
+ * Cache item pointer (48 bytes)
+ */
 typedef struct
 {
        POOL_QUERY_HASH query_hash; /* md5 hashed query signature */
@@ -98,6 +104,7 @@ typedef struct
 
 /*
  * "Cache Item header" structure is used to manage each cache item.
+ *  (24 bytes)
  */
 typedef struct
 {
@@ -204,7 +211,7 @@ typedef struct
  *--------------------------------------------------------------------------------
  */
 
-/* Hash element */
+/* Hash element (48 bytes) */
 typedef struct POOL_HASH_ELEMENT
 {
        struct POOL_HASH_ELEMENT *next; /* link to next entry */
@@ -214,7 +221,7 @@ typedef struct POOL_HASH_ELEMENT
 
 typedef uint32 POOL_HASH_KEY;
 
-/* Hash header element */
+/* Hash header element (16 bytes) */
 typedef struct
 {
        POOL_HASH_KEY hashkey;          /* hash key */