Add an index on pg_inherits.inhparent, and use it to avoid seqscans in
Tom Lane <tgl@sss.pgh.pa.us>
Add an index on pg_inherits.inhparent, and use it to avoid seqscans in find_inheritance_children(). This is a complete no-op in databases without any inheritance. In databases where there are just a few entries in pg_inherits, it could conceivably be a small loss. However, in databases with many inheritance parents, it can be a big win.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_inherits.c | modified | +68 −14 |
| src/backend/commands/tablecmds.c | modified | +8 −10 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/indexing.h | modified | +4 −1 |