partitioning code reorganization
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Andres Freund <andres@anarazel.de>
Cc: Amit Langote <amitlangote09@gmail.com>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-13T19:35:03Z
Lists: pgsql-hackers
Attachments
- v5-0001-Reorganize-partitioning-code-structure.patch (text/plain)
Andres Freund wrote: > It'd be good to adjust the thread topic - this surely isn't about the > crash anymore. And it's good, especially given we're past the feature > freeze etc, if the subject conveyed what's happening? Sure thing. This thread comes from: https://postgr.es/m/20180413182133.euxapzksj3ejxo2h@alap3.anarazel.de Here's my proposed reorganization patch. This cleans up the partitioning header files, and creates new source files. The split was described by Amit in the previous thread. The new source files are: src/backend/partitioning/partbounds.c (2057 lines) src/backend/utils/cache/partcache.c (972 lines) That code comes mostly from partition.c, but there's also some code coming from relcache.c. Two new header files are created: src/include/partitioning/partdefs.h (this one is used by most other header files needing to refer to partitioning features). src/include/utils/partcache.h This compiles with no warnings, and passes cpluspluscheck. Inclusions of catalog/partition.h all over the place has been reduced to a minimum. This is a good thing: that header was causing bleed of unrelated stuff into a lot of seemingly unrelated places, as you can see in a few files that had to gain some completely unrelated #includes: contrib/pageinspect/hashfuncs.c: +#include "utils/rel.h" contrib/pg_stat_statements/pg_stat_statements.c +#include "utils/acl.h" src/backend/catalog/pg_constraint.c +#include "access/tupconvert.h" src/backend/tcop/utility.c +#include "utils/rel.h" src/backend/utils/misc/pg_controldata.c +#include "access/xlog.h" -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Reorganize partitioning code
- da6f3e45ddb6 11.0 landed