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.
Showing
- src/backend/catalog/pg_inherits.c 68 additions, 14 deletionssrc/backend/catalog/pg_inherits.c
- src/backend/commands/tablecmds.c 8 additions, 10 deletionssrc/backend/commands/tablecmds.c
- src/include/catalog/catversion.h 2 additions, 2 deletionssrc/include/catalog/catversion.h
- src/include/catalog/indexing.h 4 additions, 1 deletionsrc/include/catalog/indexing.h
Please register or sign in to comment