LCOV - differential code coverage report
Current view: top level - src/backend/access/rmgrdesc - hashdesc.c (source / functions) Coverage Total Hit UBC CBC
Current: 4b3c9325757dfd8f2312e9f1a8decf4431f344ae vs e87b024bfb8dd55e3049b1b6e6ab4e810cf1abc8 Lines: 92.5 % 107 99 8 99
Current Date: 2026-11-28 16:48:44 +0900 Functions: 100.0 % 2 2 2
Baseline: lcov-20261128-baseline Branches: 81.8 % 44 36 8 36
Baseline Date: 2026-11-28 16:48:48 +0900 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(360..) days: 92.5 % 107 99 8 99
Function coverage date bins:
(360..) days: 100.0 % 2 2 2
Branch coverage date bins:
(360..) days: 81.8 % 44 36 8 36

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * hashdesc.c
                                  4                 :                :  *    rmgr descriptor routines for access/hash/hash.c
                                  5                 :                :  *
                                  6                 :                :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
                                  7                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  8                 :                :  *
                                  9                 :                :  *
                                 10                 :                :  * IDENTIFICATION
                                 11                 :                :  *    src/backend/access/rmgrdesc/hashdesc.c
                                 12                 :                :  *
                                 13                 :                :  *-------------------------------------------------------------------------
                                 14                 :                :  */
                                 15                 :                : #include "postgres.h"
                                 16                 :                : 
                                 17                 :                : #include "access/hash_xlog.h"
                                 18                 :                : 
                                 19                 :                : void
 4391 heikki.linnakangas@i       20                 :CBC       65922 : hash_desc(StringInfo buf, XLogReaderState *record)
                                 21                 :                : {
 3546 rhaas@postgresql.org       22                 :          65922 :     char       *rec = XLogRecGetData(record);
                                 23                 :          65922 :     uint8       info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
                                 24                 :                : 
                                 25   [ +  +  +  +  :          65922 :     switch (info)
                                     +  +  +  +  +  
                                           +  -  + ]
                                 26                 :                :     {
                                 27                 :              6 :         case XLOG_HASH_INIT_META_PAGE:
                                 28                 :                :             {
                                 29                 :              6 :                 xl_hash_init_meta_page *xlrec = (xl_hash_init_meta_page *) rec;
                                 30                 :                : 
  442 michael@paquier.xyz        31                 :              6 :                 appendStringInfo(buf, "num_tuples %g, procid %u, fillfactor %d",
                                 32                 :                :                                  xlrec->num_tuples,
                                 33                 :                :                                  xlrec->procid,
                                 34                 :              6 :                                  xlrec->ffactor);
 3546 rhaas@postgresql.org       35                 :              6 :                 break;
                                 36                 :                :             }
                                 37                 :              6 :         case XLOG_HASH_INIT_BITMAP_PAGE:
                                 38                 :                :             {
                                 39                 :              6 :                 xl_hash_init_bitmap_page *xlrec = (xl_hash_init_bitmap_page *) rec;
                                 40                 :                : 
                                 41                 :              6 :                 appendStringInfo(buf, "bmsize %d", xlrec->bmsize);
                                 42                 :              6 :                 break;
                                 43                 :                :             }
                                 44                 :          64221 :         case XLOG_HASH_INSERT:
                                 45                 :                :             {
                                 46                 :          64221 :                 xl_hash_insert *xlrec = (xl_hash_insert *) rec;
                                 47                 :                : 
                                 48                 :          64221 :                 appendStringInfo(buf, "off %u", xlrec->offnum);
                                 49                 :          64221 :                 break;
                                 50                 :                :             }
                                 51                 :            162 :         case XLOG_HASH_ADD_OVFL_PAGE:
                                 52                 :                :             {
                                 53                 :            162 :                 xl_hash_add_ovfl_page *xlrec = (xl_hash_add_ovfl_page *) rec;
                                 54                 :                : 
                                 55                 :            162 :                 appendStringInfo(buf, "bmsize %d, bmpage_found %c",
 3447 tgl@sss.pgh.pa.us          56         [ +  + ]:            324 :                                  xlrec->bmsize, (xlrec->bmpage_found) ? 'T' : 'F');
 3546 rhaas@postgresql.org       57                 :            162 :                 break;
                                 58                 :                :             }
                                 59                 :            198 :         case XLOG_HASH_SPLIT_ALLOCATE_PAGE:
                                 60                 :                :             {
                                 61                 :            198 :                 xl_hash_split_allocate_page *xlrec = (xl_hash_split_allocate_page *) rec;
                                 62                 :                : 
  442 michael@paquier.xyz        63                 :            396 :                 appendStringInfo(buf, "new_bucket %u, old_bucket_flag %u, new_bucket_flag %u, meta_page_masks_updated %c, issplitpoint_changed %c",
                                 64                 :                :                                  xlrec->new_bucket,
                                 65                 :            198 :                                  xlrec->old_bucket_flag,
                                 66                 :            198 :                                  xlrec->new_bucket_flag,
 3447 tgl@sss.pgh.pa.us          67         [ +  + ]:            198 :                                  (xlrec->flags & XLH_SPLIT_META_UPDATE_MASKS) ? 'T' : 'F',
 3546 rhaas@postgresql.org       68         [ +  + ]:            198 :                                  (xlrec->flags & XLH_SPLIT_META_UPDATE_SPLITPOINT) ? 'T' : 'F');
                                 69                 :            198 :                 break;
                                 70                 :                :             }
                                 71                 :            198 :         case XLOG_HASH_SPLIT_COMPLETE:
                                 72                 :                :             {
                                 73                 :            198 :                 xl_hash_split_complete *xlrec = (xl_hash_split_complete *) rec;
                                 74                 :                : 
                                 75                 :            198 :                 appendStringInfo(buf, "old_bucket_flag %u, new_bucket_flag %u",
 3447 tgl@sss.pgh.pa.us          76                 :            198 :                                  xlrec->old_bucket_flag, xlrec->new_bucket_flag);
 3546 rhaas@postgresql.org       77                 :            198 :                 break;
                                 78                 :                :             }
                                 79                 :             12 :         case XLOG_HASH_MOVE_PAGE_CONTENTS:
                                 80                 :                :             {
                                 81                 :             12 :                 xl_hash_move_page_contents *xlrec = (xl_hash_move_page_contents *) rec;
                                 82                 :                : 
                                 83                 :             12 :                 appendStringInfo(buf, "ntups %d, is_primary %c",
                                 84                 :             12 :                                  xlrec->ntups,
                                 85         [ +  - ]:             12 :                                  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
                                 86                 :             12 :                 break;
                                 87                 :                :             }
                                 88                 :            192 :         case XLOG_HASH_SQUEEZE_PAGE:
                                 89                 :                :             {
                                 90                 :            192 :                 xl_hash_squeeze_page *xlrec = (xl_hash_squeeze_page *) rec;
                                 91                 :                : 
  442 michael@paquier.xyz        92                 :            384 :                 appendStringInfo(buf, "prevblkno %u, nextblkno %u, ntups %d, is_primary %c, is_previous %c",
                                 93                 :                :                                  xlrec->prevblkno,
                                 94                 :                :                                  xlrec->nextblkno,
 3546 rhaas@postgresql.org       95                 :            192 :                                  xlrec->ntups,
  442 michael@paquier.xyz        96         [ +  - ]:            192 :                                  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F',
                                 97         [ +  + ]:            192 :                                  xlrec->is_prev_bucket_same_wrt ? 'T' : 'F');
 3546 rhaas@postgresql.org       98                 :            192 :                 break;
                                 99                 :                :             }
                                100                 :            294 :         case XLOG_HASH_DELETE:
                                101                 :                :             {
                                102                 :            294 :                 xl_hash_delete *xlrec = (xl_hash_delete *) rec;
                                103                 :                : 
 3540                           104                 :            588 :                 appendStringInfo(buf, "clear_dead_marking %c, is_primary %c",
                                105         [ -  + ]:            294 :                                  xlrec->clear_dead_marking ? 'T' : 'F',
 3546                           106         [ +  + ]:            294 :                                  xlrec->is_primary_bucket_page ? 'T' : 'F');
                                107                 :            294 :                 break;
                                108                 :                :             }
                                109                 :              3 :         case XLOG_HASH_UPDATE_META_PAGE:
                                110                 :                :             {
                                111                 :              3 :                 xl_hash_update_meta_page *xlrec = (xl_hash_update_meta_page *) rec;
                                112                 :                : 
 3540                           113                 :              3 :                 appendStringInfo(buf, "ntuples %g",
                                114                 :                :                                  xlrec->ntuples);
                                115                 :              3 :                 break;
                                116                 :                :             }
 3540 rhaas@postgresql.org      117                 :UBC           0 :         case XLOG_HASH_VACUUM_ONE_PAGE:
                                118                 :                :             {
                                119                 :              0 :                 xl_hash_vacuum_one_page *xlrec = (xl_hash_vacuum_one_page *) rec;
                                120                 :                : 
 1073 msawada@postgresql.o      121                 :              0 :                 appendStringInfo(buf, "ntuples %d, snapshotConflictHorizon %u, isCatalogRel %c",
 2804 andres@anarazel.de        122                 :              0 :                                  xlrec->ntuples,
                                123                 :                :                                  xlrec->snapshotConflictHorizon,
 1073 msawada@postgresql.o      124         [ #  # ]:              0 :                                  xlrec->isCatalogRel ? 'T' : 'F');
 3546 rhaas@postgresql.org      125                 :              0 :                 break;
                                126                 :                :             }
                                127                 :                :     }
 5113 alvherre@alvh.no-ip.      128                 :CBC       65922 : }
                                129                 :                : 
                                130                 :                : const char *
 4453 andres@anarazel.de        131                 :          65958 : hash_identify(uint8 info)
                                132                 :                : {
 3546 rhaas@postgresql.org      133                 :          65958 :     const char *id = NULL;
                                134                 :                : 
                                135   [ +  +  +  +  :          65958 :     switch (info & ~XLR_INFO_MASK)
                                     +  +  +  +  +  
                                        +  +  +  -  
                                                 - ]
                                136                 :                :     {
                                137                 :              9 :         case XLOG_HASH_INIT_META_PAGE:
                                138                 :              9 :             id = "INIT_META_PAGE";
                                139                 :              9 :             break;
                                140                 :              9 :         case XLOG_HASH_INIT_BITMAP_PAGE:
                                141                 :              9 :             id = "INIT_BITMAP_PAGE";
                                142                 :              9 :             break;
                                143                 :          64224 :         case XLOG_HASH_INSERT:
                                144                 :          64224 :             id = "INSERT";
                                145                 :          64224 :             break;
                                146                 :            165 :         case XLOG_HASH_ADD_OVFL_PAGE:
                                147                 :            165 :             id = "ADD_OVFL_PAGE";
                                148                 :            165 :             break;
                                149                 :            201 :         case XLOG_HASH_SPLIT_ALLOCATE_PAGE:
                                150                 :            201 :             id = "SPLIT_ALLOCATE_PAGE";
                                151                 :            201 :             break;
                                152                 :            435 :         case XLOG_HASH_SPLIT_PAGE:
                                153                 :            435 :             id = "SPLIT_PAGE";
                                154                 :            435 :             break;
                                155                 :            201 :         case XLOG_HASH_SPLIT_COMPLETE:
                                156                 :            201 :             id = "SPLIT_COMPLETE";
                                157                 :            201 :             break;
                                158                 :             15 :         case XLOG_HASH_MOVE_PAGE_CONTENTS:
                                159                 :             15 :             id = "MOVE_PAGE_CONTENTS";
                                160                 :             15 :             break;
                                161                 :            195 :         case XLOG_HASH_SQUEEZE_PAGE:
                                162                 :            195 :             id = "SQUEEZE_PAGE";
                                163                 :            195 :             break;
                                164                 :            297 :         case XLOG_HASH_DELETE:
                                165                 :            297 :             id = "DELETE";
                                166                 :            297 :             break;
                                167                 :            201 :         case XLOG_HASH_SPLIT_CLEANUP:
                                168                 :            201 :             id = "SPLIT_CLEANUP";
                                169                 :            201 :             break;
                                170                 :              6 :         case XLOG_HASH_UPDATE_META_PAGE:
                                171                 :              6 :             id = "UPDATE_META_PAGE";
                                172                 :              6 :             break;
 3545 rhaas@postgresql.org      173                 :UBC           0 :         case XLOG_HASH_VACUUM_ONE_PAGE:
                                174                 :              0 :             id = "VACUUM_ONE_PAGE";
                                175                 :                :     }
                                176                 :                : 
 3546 rhaas@postgresql.org      177                 :CBC       65958 :     return id;
                                178                 :                : }
        

Generated by: LCOV version 2.0-1