Track GC reclaims skipped in stats.
authorRobert Haas <[email protected]>
Thu, 2 Aug 2012 15:45:46 +0000 (15:45 +0000)
committerRobert Haas <[email protected]>
Thu, 2 Aug 2012 15:45:46 +0000 (15:45 +0000)
src/backend/utils/hash/chash.c
src/include/utils/chash.h

index 5586ec5ac7520456b0ed0f0eaf13d10bc8c026c0..f74cc36da33eca429451f4432562ddc563c003cb 100644 (file)
@@ -207,6 +207,7 @@ char *CHashStatisticsNames[] = {
        "garbage dequeues failed",
        "garbage collections",
        "garbage collection spins",
+       "garbage collection reclaims skipped",
        "garbage collection fast reclaims",
        "garbage collection reclaims retried",
        "<end>"
@@ -1005,7 +1006,7 @@ CHashAllocate(CHashTable table)
                         * to adjust the next-pointer in the last of the reclaimed nodes.
                         */
                        if (CHashPtrIsInvalid(fhead))
-                               ;
+                               CHashTableIncrementStatistic(table, CHS_GC_Reclaim_Skipped);
                        else if (__sync_bool_compare_and_swap(fh, InvalidCHashPtr, fhead))
                                CHashTableIncrementStatistic(table, CHS_GC_Reclaim_Fast);
                        else
index 8ff7e6403967bf2716c04a949d62fd8b7dca4acd..2c4a1af1a0404614a73cdc2efaa18a84ecd628d6 100644 (file)
@@ -45,6 +45,7 @@ typedef enum
        CHS_Garbage_Dequeue_Fail,       /* dequeue of garbage failed */
        CHS_GC,                                         /* garbage collection cycle */
        CHS_GC_Spin,                            /* GC spun waiting for concurrent process */
+       CHS_GC_Reclaim_Skipped,         /* GC recovered only one item */
        CHS_GC_Reclaim_Fast,            /* GC put garbage on freelist via fast path */
        CHS_GC_Reclaim_Retry,           /* enqueue of garbage on freelist retried */
        CHS_NumberOfStatistics          /* number of statistics */