Update pgxn/neon/relkind_cache.c

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
This commit is contained in:
Konstantin Knizhnik
2025-07-14 15:09:36 +03:00
committed by Konstantin Knizhnik
parent c3fdab3886
commit 5d93a8cc71

View File

@@ -121,9 +121,7 @@ get_pinned_entry(NRelFileInfo rinfo)
while ((entry = hash_search(relkind_hash, &rinfo, HASH_ENTER_NULL, &found)) == NULL)
{
/*
* Remove least recently used elment from the hash.
* Hash size after is becomes `relkind_hash_size-1`.
* But it is not considered to be a problem, because size of this hash is expecrted large enough and +-1 doesn't matter.
* Remove least recently used element from the hash.
*/
RelKindEntry *victim = dlist_container(RelKindEntry, lru_node, dlist_pop_head_node(&relkind_ctl->lru));
hash_search(relkind_hash, &victim->rel, HASH_REMOVE, NULL);