forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitadfeef5

Neil Conway
When enqueueing after-row triggers for updates of a table with a foreign
key, compare the new and old row versions. If the foreign key column hasnot changed, we needn't enqueue the trigger, since the update cannotviolate the foreign key. This optimization was previously applied in theRI trigger function, but it is more efficient to avoid firing the triggeraltogether. Per recent discussion on pgsql-hackers.Also add a regression test for some unintuitive foreign key behavior, andrefactor some code that deals with the OIDs of the various RI triggerfunctions.1 parentf99b75b commitadfeef5
File tree
6 files changed
+256
-150
lines changed- src
- backend
- commands
- utils/adt
- include/commands
- test/regress
- expected
- sql
6 files changed
+256
-150
lines changedLines changed: 2 additions & 42 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
156 | 156 |
| |
157 | 157 |
| |
158 | 158 |
| |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 | 159 |
| |
166 | 160 |
| |
167 | 161 |
| |
| |||
246 | 240 |
| |
247 | 241 |
| |
248 | 242 |
| |
249 |
| - | |
250 | 243 |
| |
251 | 244 |
| |
252 | 245 |
| |
| |||
1571 | 1564 |
| |
1572 | 1565 |
| |
1573 | 1566 |
| |
1574 |
| - | |
1575 |
| - | |
1576 |
| - | |
1577 |
| - | |
1578 |
| - | |
1579 |
| - | |
1580 |
| - | |
1581 |
| - | |
1582 |
| - | |
1583 |
| - | |
1584 |
| - | |
1585 |
| - | |
1586 |
| - | |
1587 |
| - | |
1588 |
| - | |
1589 |
| - | |
1590 |
| - | |
1591 |
| - | |
1592 |
| - | |
1593 |
| - | |
1594 |
| - | |
1595 |
| - | |
1596 |
| - | |
1597 |
| - | |
1598 |
| - | |
1599 |
| - | |
1600 |
| - | |
1601 |
| - | |
1602 |
| - | |
1603 |
| - | |
1604 |
| - | |
1605 |
| - | |
1606 |
| - | |
1607 | 1567 |
| |
1608 | 1568 |
| |
1609 | 1569 |
| |
| |||
1663 | 1623 |
| |
1664 | 1624 |
| |
1665 | 1625 |
| |
1666 |
| - | |
| 1626 | + | |
1667 | 1627 |
| |
1668 | 1628 |
| |
1669 | 1629 |
| |
|
Lines changed: 34 additions & 41 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
2994 | 2994 |
| |
2995 | 2995 |
| |
2996 | 2996 |
| |
2997 |
| - | |
2998 |
| - | |
2999 |
| - | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
3000 | 3000 |
| |
3001 | 3001 |
| |
3002 | 3002 |
| |
3003 |
| - | |
3004 |
| - | |
3005 |
| - | |
| 3003 | + | |
3006 | 3004 |
| |
3007 |
| - | |
3008 |
| - | |
3009 |
| - | |
3010 |
| - | |
3011 |
| - | |
3012 |
| - | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
3013 | 3012 |
| |
3014 | 3013 |
| |
3015 |
| - | |
3016 |
| - | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
3017 | 3033 |
| |
3018 |
| - | |
3019 | 3034 |
| |
3020 |
| - | |
3021 |
| - | |
3022 |
| - | |
3023 |
| - | |
3024 |
| - | |
3025 |
| - | |
3026 |
| - | |
3027 |
| - | |
3028 |
| - | |
3029 |
| - | |
3030 |
| - | |
3031 |
| - | |
3032 |
| - | |
3033 |
| - | |
3034 |
| - | |
3035 |
| - | |
3036 |
| - | |
3037 |
| - | |
3038 |
| - | |
3039 |
| - | |
3040 |
| - | |
3041 |
| - | |
3042 |
| - | |
3043 |
| - | |
3044 |
| - | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
3045 | 3038 |
| |
3046 | 3039 |
| |
3047 | 3040 |
| |
|
0 commit comments
Comments
(0)