diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-03-07 08:31:04 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-03-07 08:31:04 +0900 |
commit | e82b64a92cf5650e618b26b85ca5c0f090286bb4 (patch) | |
tree | 7cee08849edd17e97241ea329fd3e1395b93ed4e /src/backend/utils/cache | |
parent | 3b671dcf53d1e1f5a08f8a4cd204207a8c1a065e (diff) | |
download | postgresql-e82b64a92cf5650e618b26b85ca5c0f090286bb4.tar.gz postgresql-e82b64a92cf5650e618b26b85ca5c0f090286bb4.zip |
Revert "Fix parallel-safety check of expressions and predicate for index builds"
This reverts commit eae7be600be7, following a discussion with Tom Lane,
due to concerns that this impacts the decisions made by the planner for
the number of workers spawned based on the inlining and const-folding of
index expressions and predicate for cases that would have worked until
this commit.
Discussion: https://postgr.es/m/162802.1709746091@sss.pgh.pa.us
Backpatch-through: 12
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 15a642e5c96..1b7e11b93e0 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -3511,74 +3511,6 @@ get_index_column_opclass(Oid index_oid, int attno) } /* - * get_index_expressions - * - * Given the index OID, its a List of its expressions or NIL if none. - */ -List * -get_index_expressions(Oid index_oid) -{ - List *result; - HeapTuple tuple; - Datum exprDatum; - bool isnull; - char *exprString; - - tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(index_oid)); - if (!HeapTupleIsValid(tuple)) - elog(ERROR, "cache lookup failed for index %u", index_oid); - - exprDatum = SysCacheGetAttr(INDEXRELID, tuple, - Anum_pg_index_indexprs, &isnull); - if (isnull) - { - ReleaseSysCache(tuple); - return NIL; - } - - exprString = TextDatumGetCString(exprDatum); - result = (List *) stringToNode(exprString); - pfree(exprString); - ReleaseSysCache(tuple); - - return result; -} - -/* - * get_index_predicate - * - * Given the index OID, return a List of its predicate or NIL if none. - */ -List * -get_index_predicate(Oid index_oid) -{ - List *result; - HeapTuple tuple; - Datum predDatum; - bool isnull; - char *predString; - - tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(index_oid)); - if (!HeapTupleIsValid(tuple)) - elog(ERROR, "cache lookup failed for index %u", index_oid); - - predDatum = SysCacheGetAttr(INDEXRELID, tuple, - Anum_pg_index_indpred, &isnull); - if (isnull) - { - ReleaseSysCache(tuple); - return NIL; - } - - predString = TextDatumGetCString(predDatum); - result = (List *) stringToNode(predString); - pfree(predString); - ReleaseSysCache(tuple); - - return result; -} - -/* * get_index_isreplident * * Given the index OID, return pg_index.indisreplident. |