Create a syscache for pg_database-indexed-by-oid, and make use of it
Tom Lane <tgl@sss.pgh.pa.us>
Create a syscache for pg_database-indexed-by-oid, and make use of it in various places that were previously doing ad hoc pg_database searches. This may speed up database-related privilege checks a little bit, but the main motivation is to eliminate the performance reason for having ReverifyMyDatabase do such a lot of stuff (viz, avoiding repeat scans of pg_database during backend startup). The locking reason for having that routine is about to go away, and it'd be good to have the option to break it up.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/aclchk.c | modified | +37 −100 |
| src/backend/commands/dbcommands.c | modified | +17 −42 |
| src/backend/commands/vacuum.c | modified | +16 −9 |
| src/backend/postmaster/autovacuum.c | modified | +8 −21 |
| src/backend/utils/cache/syscache.c | modified | +12 −1 |
| src/backend/utils/init/postinit.c | modified | +7 −10 |
| src/include/utils/acl.h | modified | +1 −5 |
| src/include/utils/syscache.h | modified | +18 −17 |