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>
Thu, 5 Jan 2023 07:50:43 +0000 (16:50 +0900)
Some struct size added to explain required shared memory size.

src/include/query_cache/pool_memqcache.h

index ef9d6a102388a5f64dba32ee24ccfd477f08e848..d40161eeacfc1cb24896abb5be2d1866bab0d0ca 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2021     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 */