LCOV - differential code coverage report
Current view: top level - src/backend/access/rmgrdesc - hashdesc.c (source / functions) Coverage Total Hit UNC UBC DUB
Current: Differential Code Coverage HEAD vs 15 Lines: 0.0 % 103 0 1 102 1
Current Date: 2023-04-08 17:13:01 Functions: 0.0 % 2 0 1 1
Baseline: 15 Line coverage date bins:
Baseline Date: 2023-04-08 15:09:40 (120,180] days: 0.0 % 1 0 1
Legend: Lines: hit not hit (240..) days: 0.0 % 102 0 102
Function coverage date bins:
(240..) days: 0.0 % 2 0 1 1

 Age         Owner                  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-2023, 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
 3062 heikki.linnakangas         20 UBC           0 : hash_desc(StringInfo buf, XLogReaderState *record)
                                 21                 : {
 2217 rhaas                      22               0 :     char       *rec = XLogRecGetData(record);
                                 23               0 :     uint8       info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
                                 24                 : 
                                 25               0 :     switch (info)
                                 26                 :     {
                                 27               0 :         case XLOG_HASH_INIT_META_PAGE:
                                 28                 :             {
                                 29               0 :                 xl_hash_init_meta_page *xlrec = (xl_hash_init_meta_page *) rec;
                                 30                 : 
                                 31               0 :                 appendStringInfo(buf, "num_tuples %g, fillfactor %d",
                                 32               0 :                                  xlrec->num_tuples, xlrec->ffactor);
                                 33               0 :                 break;
                                 34                 :             }
                                 35               0 :         case XLOG_HASH_INIT_BITMAP_PAGE:
                                 36                 :             {
                                 37               0 :                 xl_hash_init_bitmap_page *xlrec = (xl_hash_init_bitmap_page *) rec;
                                 38                 : 
                                 39               0 :                 appendStringInfo(buf, "bmsize %d", xlrec->bmsize);
                                 40               0 :                 break;
                                 41                 :             }
                                 42               0 :         case XLOG_HASH_INSERT:
                                 43                 :             {
                                 44               0 :                 xl_hash_insert *xlrec = (xl_hash_insert *) rec;
                                 45                 : 
                                 46               0 :                 appendStringInfo(buf, "off %u", xlrec->offnum);
                                 47               0 :                 break;
                                 48                 :             }
                                 49               0 :         case XLOG_HASH_ADD_OVFL_PAGE:
                                 50                 :             {
                                 51               0 :                 xl_hash_add_ovfl_page *xlrec = (xl_hash_add_ovfl_page *) rec;
                                 52                 : 
                                 53               0 :                 appendStringInfo(buf, "bmsize %d, bmpage_found %c",
 2118 tgl                        54               0 :                                  xlrec->bmsize, (xlrec->bmpage_found) ? 'T' : 'F');
 2217 rhaas                      55               0 :                 break;
                                 56                 :             }
                                 57               0 :         case XLOG_HASH_SPLIT_ALLOCATE_PAGE:
                                 58                 :             {
                                 59               0 :                 xl_hash_split_allocate_page *xlrec = (xl_hash_split_allocate_page *) rec;
                                 60                 : 
                                 61               0 :                 appendStringInfo(buf, "new_bucket %u, meta_page_masks_updated %c, issplitpoint_changed %c",
                                 62                 :                                  xlrec->new_bucket,
 2118 tgl                        63               0 :                                  (xlrec->flags & XLH_SPLIT_META_UPDATE_MASKS) ? 'T' : 'F',
 2217 rhaas                      64               0 :                                  (xlrec->flags & XLH_SPLIT_META_UPDATE_SPLITPOINT) ? 'T' : 'F');
                                 65               0 :                 break;
                                 66                 :             }
                                 67               0 :         case XLOG_HASH_SPLIT_COMPLETE:
                                 68                 :             {
                                 69               0 :                 xl_hash_split_complete *xlrec = (xl_hash_split_complete *) rec;
                                 70                 : 
                                 71               0 :                 appendStringInfo(buf, "old_bucket_flag %u, new_bucket_flag %u",
 2118 tgl                        72               0 :                                  xlrec->old_bucket_flag, xlrec->new_bucket_flag);
 2217 rhaas                      73               0 :                 break;
                                 74                 :             }
                                 75               0 :         case XLOG_HASH_MOVE_PAGE_CONTENTS:
                                 76                 :             {
                                 77               0 :                 xl_hash_move_page_contents *xlrec = (xl_hash_move_page_contents *) rec;
                                 78                 : 
                                 79               0 :                 appendStringInfo(buf, "ntups %d, is_primary %c",
                                 80               0 :                                  xlrec->ntups,
                                 81               0 :                                  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
                                 82               0 :                 break;
                                 83                 :             }
                                 84               0 :         case XLOG_HASH_SQUEEZE_PAGE:
                                 85                 :             {
                                 86               0 :                 xl_hash_squeeze_page *xlrec = (xl_hash_squeeze_page *) rec;
                                 87                 : 
                                 88               0 :                 appendStringInfo(buf, "prevblkno %u, nextblkno %u, ntups %d, is_primary %c",
                                 89                 :                                  xlrec->prevblkno,
                                 90                 :                                  xlrec->nextblkno,
                                 91               0 :                                  xlrec->ntups,
                                 92               0 :                                  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
                                 93               0 :                 break;
                                 94                 :             }
                                 95               0 :         case XLOG_HASH_DELETE:
                                 96                 :             {
                                 97               0 :                 xl_hash_delete *xlrec = (xl_hash_delete *) rec;
                                 98                 : 
 2211                            99               0 :                 appendStringInfo(buf, "clear_dead_marking %c, is_primary %c",
                                100               0 :                                  xlrec->clear_dead_marking ? 'T' : 'F',
 2217                           101               0 :                                  xlrec->is_primary_bucket_page ? 'T' : 'F');
                                102               0 :                 break;
                                103                 :             }
                                104               0 :         case XLOG_HASH_UPDATE_META_PAGE:
                                105                 :             {
                                106               0 :                 xl_hash_update_meta_page *xlrec = (xl_hash_update_meta_page *) rec;
                                107                 : 
 2211                           108               0 :                 appendStringInfo(buf, "ntuples %g",
                                109                 :                                  xlrec->ntuples);
                                110               0 :                 break;
                                111                 :             }
                                112               0 :         case XLOG_HASH_VACUUM_ONE_PAGE:
                                113                 :             {
                                114               0 :                 xl_hash_vacuum_one_page *xlrec = (xl_hash_vacuum_one_page *) rec;
                                115                 : 
  143 pg                        116 UNC           0 :                 appendStringInfo(buf, "ntuples %d, snapshotConflictHorizon %u",
 1475 andres                    117 UBC           0 :                                  xlrec->ntuples,
                                118                 :                                  xlrec->snapshotConflictHorizon);
 2217 rhaas                     119               0 :                 break;
                                120                 :             }
                                121                 :     }
 3784 alvherre                  122               0 : }
                                123                 : 
                                124                 : const char *
 3124 andres                    125               0 : hash_identify(uint8 info)
                                126                 : {
 2217 rhaas                     127               0 :     const char *id = NULL;
                                128                 : 
                                129               0 :     switch (info & ~XLR_INFO_MASK)
                                130                 :     {
                                131               0 :         case XLOG_HASH_INIT_META_PAGE:
                                132               0 :             id = "INIT_META_PAGE";
                                133               0 :             break;
                                134               0 :         case XLOG_HASH_INIT_BITMAP_PAGE:
                                135               0 :             id = "INIT_BITMAP_PAGE";
                                136               0 :             break;
                                137               0 :         case XLOG_HASH_INSERT:
                                138               0 :             id = "INSERT";
                                139               0 :             break;
                                140               0 :         case XLOG_HASH_ADD_OVFL_PAGE:
                                141               0 :             id = "ADD_OVFL_PAGE";
                                142               0 :             break;
                                143               0 :         case XLOG_HASH_SPLIT_ALLOCATE_PAGE:
                                144               0 :             id = "SPLIT_ALLOCATE_PAGE";
                                145               0 :             break;
                                146               0 :         case XLOG_HASH_SPLIT_PAGE:
                                147               0 :             id = "SPLIT_PAGE";
                                148               0 :             break;
                                149               0 :         case XLOG_HASH_SPLIT_COMPLETE:
                                150               0 :             id = "SPLIT_COMPLETE";
                                151               0 :             break;
                                152               0 :         case XLOG_HASH_MOVE_PAGE_CONTENTS:
                                153               0 :             id = "MOVE_PAGE_CONTENTS";
                                154               0 :             break;
                                155               0 :         case XLOG_HASH_SQUEEZE_PAGE:
                                156               0 :             id = "SQUEEZE_PAGE";
                                157               0 :             break;
                                158               0 :         case XLOG_HASH_DELETE:
                                159               0 :             id = "DELETE";
                                160               0 :             break;
                                161               0 :         case XLOG_HASH_SPLIT_CLEANUP:
                                162               0 :             id = "SPLIT_CLEANUP";
                                163               0 :             break;
                                164               0 :         case XLOG_HASH_UPDATE_META_PAGE:
                                165               0 :             id = "UPDATE_META_PAGE";
                                166               0 :             break;
 2216                           167               0 :         case XLOG_HASH_VACUUM_ONE_PAGE:
                                168               0 :             id = "VACUUM_ONE_PAGE";
                                169                 :     }
                                170                 : 
 2217                           171               0 :     return id;
                                172                 : }
        

Generated by: LCOV version v1.16-55-g56c0a2a