- Notifications
You must be signed in to change notification settings - Fork5
Commitcd203f3
Jan Wieck
Jan Wieck
Avoid primary key lookup (and lock) if foreign key does not change
on UPDATE.This get's rid of the long standing annoyance that updating a rowthat has foreign keys locks all the referenced rows even if theforeign key values do not change.The trick is to actually do a check identical to NO ACTION after aneventually done UPDATE in the SET DEFAULT case. Since a SET DEFAULToperation should have moved referencing rows to a new "home", a followingNO ACTION check can only fail if the column defaults of the referencingtable resulted in the key we actually deleted. Thanks to Stephan.Jan1 parentafe1185 commitcd203f3
File tree
2 files changed
+34
-8
lines changed- src
- backend/utils/adt
- test/regress/expected
2 files changed
+34
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 398 | + | |
| 399 | + | |
404 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
405 | 411 | | |
406 | 412 | | |
407 | 413 | | |
| |||
2397 | 2403 | | |
2398 | 2404 | | |
2399 | 2405 | | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
2400 | 2416 | | |
2401 | 2417 | | |
2402 | 2418 | | |
| |||
2635 | 2651 | | |
2636 | 2652 | | |
2637 | 2653 | | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
2638 | 2664 | | |
2639 | 2665 | | |
2640 | 2666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | | - | |
| 885 | + | |
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| |||
0 commit comments
Comments
(0)