summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rowley2021-04-02 21:41:43 +0000
committerDavid Rowley2021-04-02 21:41:43 +0000
commit1267d9862fc6a4f8cdc0ca38d1988b61f39da585 (patch)
treecda60dbaf34bb152447521cff3d934708c27a721
parent84bc2b17523ef485f102be7f00f7affb88f00f18 (diff)
Remove useless Asserts in Result Cache code
Testing if an unsigned variable is >= 0 is pretty pointless. There's likely enough code in remove_cache_entry() to verify the cache memory accounting is correct in assert enabled builds. These Asserts were not adding much extra cover, even if they had been checking >= 0 on a signed variable. Reported-by: Andres Freund Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/backend/executor/nodeResultCache.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/backend/executor/nodeResultCache.c b/src/backend/executor/nodeResultCache.c
index c8de818c8ca..99a2045681b 100644
--- a/src/backend/executor/nodeResultCache.c
+++ b/src/backend/executor/nodeResultCache.c
@@ -286,8 +286,6 @@ entry_purge_tuples(ResultCacheState *rcstate, ResultCacheEntry *entry)
/* Update the memory accounting */
rcstate->mem_used -= freed_mem;
-
- Assert(rcstate->mem_used >= 0);
}
/*
@@ -346,8 +344,6 @@ remove_cache_entry(ResultCacheState *rcstate, ResultCacheEntry *entry)
*/
rcstate->mem_used -= EMPTY_ENTRY_MEMORY_BYTES(entry);
- Assert(rcstate->mem_used >= 0);
-
/* Remove the entry from the cache */
resultcache_delete_item(rcstate->hashtable, entry);