aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/utils/cache/relcache.c42
-rw-r--r--src/include/utils/rel.h1
-rw-r--r--src/include/utils/snapmgr.h1
3 files changed, 0 insertions, 44 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 248860758ca..585dcee5dbc 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -5914,48 +5914,6 @@ RelationIdIsInInitFile(Oid relationId)
}
/*
- * Tells whether any index for the relation is unlogged.
- *
- * Note: There doesn't seem to be any way to have an unlogged index attached
- * to a permanent table, but it seems best to keep this general so that it
- * returns sensible results even when they seem obvious (like for an unlogged
- * table) and to handle possible future unlogged indexes on permanent tables.
- */
-bool
-RelationHasUnloggedIndex(Relation rel)
-{
- List *indexoidlist;
- ListCell *indexoidscan;
- bool result = false;
-
- indexoidlist = RelationGetIndexList(rel);
-
- foreach(indexoidscan, indexoidlist)
- {
- Oid indexoid = lfirst_oid(indexoidscan);
- HeapTuple tp;
- Form_pg_class reltup;
-
- tp = SearchSysCache1(RELOID, ObjectIdGetDatum(indexoid));
- if (!HeapTupleIsValid(tp))
- elog(ERROR, "cache lookup failed for relation %u", indexoid);
- reltup = (Form_pg_class) GETSTRUCT(tp);
-
- if (reltup->relpersistence == RELPERSISTENCE_UNLOGGED)
- result = true;
-
- ReleaseSysCache(tp);
-
- if (result == true)
- break;
- }
-
- list_free(indexoidlist);
-
- return result;
-}
-
-/*
* Invalidate (remove) the init file during commit of a transaction that
* changed one or more of the relation cache entries that are kept in the
* local init file.
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index c5d36680a2b..91b3b1b9029 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -605,6 +605,5 @@ typedef struct ViewOptions
/* routines in utils/cache/relcache.c */
extern void RelationIncrementReferenceCount(Relation rel);
extern void RelationDecrementReferenceCount(Relation rel);
-extern bool RelationHasUnloggedIndex(Relation rel);
#endif /* REL_H */
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 8c070d7f412..67b07df48cb 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -40,7 +40,6 @@
RelationNeedsWAL(rel) \
&& !IsCatalogRelation(rel) \
&& !RelationIsAccessibleInLogicalDecoding(rel) \
- && !RelationHasUnloggedIndex(rel) \
)
#define EarlyPruningEnabled(rel) (old_snapshot_threshold >= 0 && RelationAllowsEarlyPruning(rel))