Commit 5b0c7e2
committed
Don't needlessly check the partition contraint twice
Starting with commit f0e4475, ExecConstraints was in charge of
running the partition constraint; commit 19c47e7 modified that so
that caller could request to skip that checking depending on some
conditions, but that commit and 15ce775 together introduced a small
bug there which caused ExecInsert to request skipping the constraint
check but have this not be honored -- in effect doing the check twice.
This could have been fixed in a very small patch, but on further
analysis of the involved function and its callsites, it turns out to be
simpler to give the responsibility of checking the partition constraint
fully to the caller, and return ExecConstraints to its original
(pre-partitioning) shape where it only checked tuple descriptor-related
constraints. Each caller must do partition constraint checking on its
own schedule, which is more convenient after commit 2f17844 anyway.
Reported-by: David Rowley
Author: David Rowley, Álvaro Herrera
Reviewed-by: Amit Langote, Amit Khandekar, Simon Riggs
Discussion: https://postgr.es/m/CAKJS1f8w8+awsxgea8wt7_UX8qzOQ=Tm1LD+U1fHqBAkXxkW2w@mail.gmail.com1 parent 85dd744 commit 5b0c7e2
File tree
6 files changed
+56
-62
lines changed- src
- backend
- commands
- executor
- include/executor
6 files changed
+56
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2725 | 2725 | | |
2726 | 2726 | | |
2727 | 2727 | | |
2728 | | - | |
2729 | | - | |
2730 | | - | |
2731 | | - | |
2732 | | - | |
2733 | | - | |
2734 | | - | |
2735 | | - | |
2736 | | - | |
2737 | | - | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
2743 | | - | |
2744 | 2728 | | |
2745 | 2729 | | |
2746 | 2730 | | |
2747 | 2731 | | |
2748 | 2732 | | |
2749 | | - | |
2750 | | - | |
2751 | | - | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
2752 | 2747 | | |
2753 | 2748 | | |
2754 | 2749 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1856 | 1856 | | |
1857 | 1857 | | |
1858 | 1858 | | |
1859 | | - | |
1860 | | - | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
1861 | 1862 | | |
1862 | 1863 | | |
1863 | 1864 | | |
1864 | | - | |
| 1865 | + | |
1865 | 1866 | | |
1866 | 1867 | | |
| 1868 | + | |
1867 | 1869 | | |
1868 | 1870 | | |
1869 | 1871 | | |
| |||
1890 | 1892 | | |
1891 | 1893 | | |
1892 | 1894 | | |
1893 | | - | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
1894 | 1902 | | |
1895 | 1903 | | |
1896 | 1904 | | |
| |||
1951 | 1959 | | |
1952 | 1960 | | |
1953 | 1961 | | |
1954 | | - | |
1955 | | - | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1956 | 1965 | | |
1957 | 1966 | | |
1958 | 1967 | | |
1959 | | - | |
| 1968 | + | |
1960 | 1969 | | |
1961 | 1970 | | |
1962 | 1971 | | |
1963 | | - | |
1964 | | - | |
| 1972 | + | |
1965 | 1973 | | |
1966 | 1974 | | |
1967 | 1975 | | |
| |||
2076 | 2084 | | |
2077 | 2085 | | |
2078 | 2086 | | |
2079 | | - | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | 2087 | | |
2084 | 2088 | | |
2085 | | - | |
2086 | 2089 | | |
2087 | 2090 | | |
2088 | 2091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 204 | + | |
| 205 | + | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
| |||
478 | 480 | | |
479 | 481 | | |
480 | 482 | | |
481 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
482 | 486 | | |
483 | 487 | | |
484 | 488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | 368 | | |
379 | 369 | | |
380 | 370 | | |
| |||
402 | 392 | | |
403 | 393 | | |
404 | 394 | | |
405 | | - | |
406 | | - | |
| 395 | + | |
407 | 396 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 397 | + | |
| 398 | + | |
412 | 399 | | |
413 | | - | |
414 | | - | |
415 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
416 | 410 | | |
417 | 411 | | |
418 | 412 | | |
| |||
1037 | 1031 | | |
1038 | 1032 | | |
1039 | 1033 | | |
1040 | | - | |
| 1034 | + | |
1041 | 1035 | | |
1042 | 1036 | | |
1043 | 1037 | | |
| |||
1168 | 1162 | | |
1169 | 1163 | | |
1170 | 1164 | | |
1171 | | - | |
| 1165 | + | |
1172 | 1166 | | |
1173 | 1167 | | |
1174 | 1168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
| 183 | + | |
185 | 184 | | |
186 | | - | |
| 185 | + | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
0 commit comments