WIP: Improve getBaseTypeAndTypemod() performance for builtin types. simple_statement_perf
authorAndres Freund <[email protected]>
Thu, 14 Sep 2017 02:29:45 +0000 (19:29 -0700)
committerAndres Freund <[email protected]>
Sun, 8 Oct 2017 16:41:56 +0000 (09:41 -0700)
Author: Robert Haas
Discussion: https://postgr.es/m/

src/backend/utils/cache/lsyscache.c

index b7a14dc87e14801029c82e690087c43f4843c481..2a22da148990811ed5a143c722dce32ded887959 100644 (file)
@@ -2295,6 +2295,9 @@ getBaseTypeAndTypmod(Oid typid, int32 *typmod)
        HeapTuple   tup;
        Form_pg_type typTup;
 
+       if (typid < FirstBootstrapObjectId)
+           break;
+
        tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
        if (!HeapTupleIsValid(tup))
            elog(ERROR, "cache lookup failed for type %u", typid);