Re: split tablecmds.c - Mailing list pgsql-hackers
| From | Álvaro Herrera |
|---|---|
| Subject | Re: split tablecmds.c |
| Date | |
| Msg-id | 202512011910.rfkycd4x7mcg@alvherre.pgsql Whole thread Raw |
| In response to | Re: split tablecmds.c (Tom Lane <tgl@sss.pgh.pa.us>) |
| List | pgsql-hackers |
On 2025-Dec-01, Tom Lane wrote:
> I didn't do any math about it, but that's got to be a far faster rate
> of expansion than the overall PG code base. Maybe partitioning is
> largely to blame? Perhaps analyzing what functionality got added
> here in the past dozen or so years would yield some ideas for how to
> split it.
Since 2015, with a cutoff of at least 50 lines added or removed:
199 lines added by: bdc3d7fa237 (Return ObjectAddress in many ALTER TABLE sub-routines, 2015-03-25)
61 lines added by: e42375fc812 (Retain comments on indexes and constraints at ALTER TABLE ... TYPE ..., 2015-07-14)
1313 lines added by: f0e44751d71 (Implement table partitioning., 2016-12-07)
58 lines added by: 3957b58b888 (Fix ALTER TABLE / SET TYPE for irregular inheritance, 2017-01-09)
74 lines removed by 2f5c9d9c9ce (Tweak catalog indexing abstraction for upcoming WARM, 2017-01-31)
283 lines added by: 32173270536 (Identity columns, 2017-04-06)
55 lines removed by 3ec76ff1f2c (Don't explicitly mark range partitioning columns NOT NULL., 2017-05-18)
58 lines removed by b08df9cab77 (Teach predtest.c about CHECK clauses to fix partitioning bugs., 2017-06-14)
131 lines added by: 6f6b99d1335 (Allow a partitioned table to have a default partition., 2017-09-08)
66 lines added by: af20e2d728e (Fix ALTER TABLE code to update domain constraints when needed., 2017-11-01)
59 lines removed by ef6087ee5fa (Minor preparatory refactoring for UPDATE row movement., 2018-01-04)
531 lines added by: 8b08f7d4820 (Local partitioned indexes, 2018-01-19)
67 lines added by: eb7ed3f3063 (Allow UNIQUE indexes on partitioned tables, 2018-02-19)
136 lines added by: 86f575948c7 (Allow FOR EACH ROW triggers on partitioned tables, 2018-03-23)
121 lines added by: 3de241dba86 (Foreign keys on partitioned tables, 2018-04-04)
86 lines added by: 5dfd1e5a669 (Logical decoding of TRUNCATE, 2018-04-07)
54 lines added by: dfa60814198 (Fix tablespace handling for partitioned indexes, 2018-11-03)
237 lines removed by 578b229718e (Remove WITH OIDS support, change oid catalog column visibility., 2018-11-20)
77 lines added by: 3b174b1a355 (Fix missing values when doing ALTER TABLE ALTER COLUMN TYPE, 2019-01-10)
306 lines added by: 03afae201f0 (Move CloneForeignKeyConstraints to tablecmds.c, 2019-01-18)
67 lines added by: 0464fdf07f6 (Create action triggers when partitions are detached, 2019-01-21)
69 lines added by: bbb96c3704c (Allow ALTER TABLE .. SET NOT NULL to skip provably unnecessary scans., 2019-03-13)
84 lines removed by d25f519107b (tableam: relation creation, VACUUM FULL/CLUSTER, SET TABLESPACE., 2019-03-28)
131 lines added by: fc22b6623b6 (Generated columns, 2019-03-30)
588 lines added by: f56f8f8da6a (Support foreign keys that reference partitioned tables, 2019-04-03)
82 lines added by: f4a3fdfbdcd (Avoid order-of-execution problems with ALTER TABLE ADD PRIMARY KEY., 2019-04-23)
61 lines added by: 1fa846f1c9a (Fix cloning of row triggers to sub-partitions, 2020-01-02)
159 lines added by: f595117e24a (ALTER TABLE ... ALTER COLUMN ... DROP EXPRESSION, 2020-01-14)
280 lines added by: 1281a5c907b (Restructure ALTER TABLE execution to fix assorted bugs., 2020-01-15)
64 lines added by: afccd76f1cc (Fix detaching partitions with cloned row triggers, 2020-04-21)
51 lines added by: 086ffddf365 (Fix several DDL issues of generated columns versus inheritance, 2020-05-06)
55 lines removed by f1fcf2d3b2e (Fix timing issue with ALTER TABLE's validate constraint, 2020-07-14)
84 lines added by: 50289819230 (Fix handling of CREATE TABLE LIKE with inheritance., 2020-08-21)
229 lines added by: bbe0a81db69 (Allow configurable LZ4 TOAST compression., 2021-03-19)
352 lines added by: 71f4c8c6f74 (ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY, 2021-03-25)
92 lines added by: a4d75c86bf1 (Extended statistics on expressions, 2021-03-26)
125 lines added by: 8ff1c94649f (Allow TRUNCATE command to truncate foreign tables., 2021-04-08)
60 lines added by: a970edbed30 (Fix ALTER TABLE / INHERIT with generated columns, 2021-05-04)
120 lines added by: 6f70d7ca1d1 (Have ALTER CONSTRAINT recurse on partitioned tables, 2021-05-05)
105 lines added by: 2ed532ee8c4 (Improve error messages about mismatching relkind, 2021-07-08)
60 lines added by: b0483263dda (Add support for SET ACCESS METHOD in ALTER TABLE, 2021-07-28)
85 lines added by: d6f96ed94e7 (Allow specifying column list for foreign key ON DELETE SET actions, 2021-12-08)
283 lines added by: f4566345cf4 (Create foreign key triggers in partitioned tables too, 2022-01-05)
668 lines added by: e056c557aef (Catalog NOT NULL constraints, 2023-04-07)
668 lines removed by 9ce04b50e12 (Revert "Catalog NOT NULL constraints" and fallout, 2023-04-12)
753 lines added by: b0e96f31198 (Catalog not-null constraints, 2023-08-25)
102 lines added by: 04e485273b5 (Move BuildDescForRelation() from tupdesc.c to tablecmds.c, 2023-10-05)
137 lines added by: 5d06e99a3cf (ALTER TABLE command to change generation expression, 2024-01-04)
159 lines added by: 69958631570 (Support identity columns in partitioned tables, 2024-01-16)
56 lines added by: f7cf9494bad (Split some code out from MergeAttributes(), 2024-01-26)
146 lines added by: 34768ee3616 (Add temporal FOREIGN KEY contraints, 2024-03-24)
105 lines added by: 374c7a22904 (Allow specifying an access method for partitioned tables, 2024-03-25)
320 lines added by: 1adf16b8fba (Implement ALTER TABLE ... MERGE PARTITIONS ... command, 2024-04-07)
411 lines added by: 87c21bb9412 (Implement ALTER TABLE ... SPLIT PARTITION ... command, 2024-04-07)
51 lines added by: d9f686a72ee (Fix restore of not-null constraints with inheritance, 2024-04-18)
828 lines removed by 6f8bb7c1e96 (Revert structural changes to not-null constraints, 2024-05-13)
150 lines removed by 8aee330af55 (Revert temporal primary keys and foreign keys, 2024-05-16)
785 lines removed by 3890d90c150 (Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands, 2024-08-24)
146 lines added by: 89f908a6d0a (Add temporal FOREIGN KEY contraints, 2024-09-17)
51 lines added by: d69a3f4d70b (Introduce ATT_PARTITIONED_TABLE in tablecmds.c, 2024-09-19)
167 lines added by: 53af9491a04 (Restructure foreign key handling code for ATTACH/DETACH, 2024-10-22)
390 lines added by: 14e87ffa5c5 (Add pg_constraint rows for not-null constraints, 2024-11-08)
52 lines added by: 9321d2fdf80 (Fix collation handling for foreign keys, 2024-11-15)
59 lines added by: 86374c9a0e3 (Split ATExecValidateConstraint into reusable pieces, 2025-01-16)
58 lines added by: b663b9436e7 (Allow NOT VALID foreign key constraints on partitioned tables, 2025-01-23)
120 lines added by: 83ea6c54025 (Virtual generated columns, 2025-02-07)
85 lines added by: f4e53e10b6c (Add ALTER TABLE ... ALTER CONSTRAINT ... SET [NO] INHERIT, 2025-03-05)
89 lines added by: 1d26c2d2c4b (refactor: Split tryAttachPartitionForeignKey(), 2025-03-11)
57 lines added by: 639238b978f (refactor: Split ATExecAlterConstraintInternal(), 2025-03-25)
309 lines added by: eec0040c4bc (Add support for NOT ENFORCED in foreign key constraints, 2025-04-02)
183 lines added by: a379061a22a (Allow NOT NULL constraints to be added as NOT VALID, 2025-04-07)
50 lines removed by 3231fd04552 (Stop creating constraints during DETACH CONCURRENTLY, 2025-10-11)
git log --since '01/01/2015' --format=reference --reverse src/backend/commands/tablecmds.c | while read line; do
sha1=$(echo$line | cut -d" " -f1); sz=$(git show $sha1:src/backend/commands/tablecmds.c | wc); prevsz=$currsz;
currsz=$(echo$sz | awk '{print $1}'); if [ ! -z "$prevsz" ]; then diff=$(($currsz - $prevsz)); if [ $diff -ge 50 ];
thenecho "$diff lines added by: $line" ; elif [ $diff -le -50 ]; then echo "$((-$diff)) lines removed by $line"; fi;
fi;done
(BTW this output makes it clear to me that commit titles do not end with
a period.)
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"You don't solve a bad join with SELECT DISTINCT" #CupsOfFail
https://twitter.com/connor_mc_d/status/1431240081726115845
pgsql-hackers by date: