- Notifications
You must be signed in to change notification settings - Fork5
Commit8d19d0e
committed
Teach parser to transform "x IS [NOT] DISTINCT FROM NULL" to a NullTest.
Now that we've nailed down the principle that NullTest with !argisrowis fully equivalent to SQL's IS [NOT] DISTINCT FROM NULL, let's teachthe parser about it. This produces a slightly more compact parse treeand is much more amenable to optimization than a DistinctExpr, sincethe planner knows a good deal about NullTest and next to nothing aboutDistinctExpr.I'm not sure that there are all that many queries in the wild that couldbe improved by this, but at least one source of such cases is the patchjust made to postgres_fdw to emit IS [NOT] DISTINCT FROM NULL whenIS [NOT] NULL isn't semantically correct.No back-patch, since to the extent that this does affect planning results,it might be considered undesirable plan destabilization.1 parentef5d4a3 commit8d19d0e
File tree
4 files changed
+65
-16
lines changed- src
- backend
- nodes
- parser
- include/nodes
4 files changed
+65
-16
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2903 | 2903 |
| |
2904 | 2904 |
| |
2905 | 2905 |
| |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
2906 | 2910 |
| |
2907 | 2911 |
| |
2908 | 2912 |
| |
|
Lines changed: 2 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11839 | 11839 |
| |
11840 | 11840 |
| |
11841 | 11841 |
| |
11842 |
| - | |
11843 |
| - | |
11844 |
| - | |
| 11842 | + | |
11845 | 11843 |
| |
11846 | 11844 |
| |
11847 | 11845 |
| |
| |||
12025 | 12023 |
| |
12026 | 12024 |
| |
12027 | 12025 |
| |
12028 |
| - | |
12029 |
| - | |
12030 |
| - | |
| 12026 | + | |
12031 | 12027 |
| |
12032 | 12028 |
| |
12033 | 12029 |
| |
|
Lines changed: 58 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| 127 | + | |
| 128 | + | |
127 | 129 |
| |
128 | 130 |
| |
129 | 131 |
| |
| |||
224 | 226 |
| |
225 | 227 |
| |
226 | 228 |
| |
| 229 | + | |
227 | 230 |
| |
228 | 231 |
| |
229 | 232 |
| |
| |||
991 | 994 |
| |
992 | 995 |
| |
993 | 996 |
| |
| 997 | + | |
994 | 998 |
| |
995 | 999 |
| |
996 | 1000 |
| |
997 | 1001 |
| |
998 | 1002 |
| |
999 | 1003 |
| |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1000 | 1014 |
| |
1001 | 1015 |
| |
1002 | 1016 |
| |
1003 | 1017 |
| |
1004 | 1018 |
| |
1005 | 1019 |
| |
1006 | 1020 |
| |
1007 |
| - | |
1008 |
| - | |
1009 |
| - | |
1010 |
| - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1011 | 1025 |
| |
1012 | 1026 |
| |
1013 | 1027 |
| |
1014 | 1028 |
| |
1015 |
| - | |
1016 |
| - | |
1017 |
| - | |
1018 |
| - | |
1019 |
| - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1020 | 1034 |
| |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1021 | 1046 |
| |
1022 | 1047 |
| |
1023 | 1048 |
| |
| |||
2869 | 2894 |
| |
2870 | 2895 |
| |
2871 | 2896 |
| |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
2872 | 2919 |
| |
2873 | 2920 |
| |
2874 | 2921 |
| |
| |||
2971 | 3018 |
| |
2972 | 3019 |
| |
2973 | 3020 |
| |
2974 |
| - | |
| 3021 | + | |
| 3022 | + | |
2975 | 3023 |
| |
2976 | 3024 |
| |
2977 | 3025 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
237 | 237 |
| |
238 | 238 |
| |
239 | 239 |
| |
| 240 | + | |
240 | 241 |
| |
241 | 242 |
| |
242 | 243 |
| |
|
0 commit comments
Comments
(0)