forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdecb08e
committed
Code review for NextValueExpr expression node type.
Add missing infrastructure for this node type, notably in ruleutils.c whereits lack could demonstrably cause EXPLAIN to fail. Add outfuncs/readfuncssupport. (outfuncs support is useful today for debugging purposes. Thereadfuncs support may never be needed, since at present it would onlymatter for parallel query and NextValueExpr should never appear in aparallelizable query; but it seems like a bad idea to have a primnode typethat isn't fully supported here.) Teach planner infrastructure thatNextValueExpr is a volatile, parallel-unsafe, non-leaky expression nodewith cost cpu_operator_cost. Given its limited scope of usage, there*might* be no live bug today from the lack of that knowledge, but it'scertainly going to bite us on the rear someday. Teach pg_stat_statementsabout the new node type, too.While at it, also teach cost_qual_eval() that MinMaxExpr, SQLValueFunction,XmlExpr, and CoerceToDomain should be charged as cpu_operator_cost.Failing to do this for SQLValueFunction was an oversight in my commit0bb51aa. The others are longer-standing oversights, but no time like thepresent to fix them. (In principle, CoerceToDomain could have cost muchhigher than this, but it doesn't presently seem worth trying to examine thedomain's constraints here.)Modify execExprInterp.c to execute NextValueExpr as an out-of-linefunction; it seems quite unlikely to me that it's worth insisting thatit be inlined in all expression eval methods. Besides, providing theout-of-line function doesn't stop anyone from inlining if they want to.Adjust some places where NextValueExpr support had been inserted with theaid of a dartboard rather than keeping it in the same order as elsewhere.Discussion:https://postgr.es/m/23862.1499981661@sss.pgh.pa.us1 parentc95275f commitdecb08e
File tree
12 files changed
+147
-47
lines changed- contrib/pg_stat_statements
- src
- backend
- catalog
- executor
- nodes
- optimizer
- path
- util
- utils/adt
- include
- executor
- nodes
12 files changed
+147
-47
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2763 | 2763 |
| |
2764 | 2764 |
| |
2765 | 2765 |
| |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
2766 | 2774 |
| |
2767 | 2775 |
| |
2768 | 2776 |
| |
|
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1791 | 1791 |
| |
1792 | 1792 |
| |
1793 | 1793 |
| |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
1794 | 1801 |
| |
1795 | 1802 |
| |
1796 | 1803 |
| |
| |||
1942 | 1949 |
| |
1943 | 1950 |
| |
1944 | 1951 |
| |
1945 |
| - | |
1946 |
| - | |
1947 |
| - | |
1948 |
| - | |
1949 |
| - | |
1950 |
| - | |
1951 |
| - | |
1952 | 1952 |
| |
1953 | 1953 |
| |
1954 | 1954 |
| |
|
Lines changed: 31 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1232 | 1232 |
| |
1233 | 1233 |
| |
1234 | 1234 |
| |
1235 |
| - | |
1236 |
| - | |
1237 |
| - | |
1238 |
| - | |
1239 |
| - | |
1240 |
| - | |
1241 |
| - | |
1242 |
| - | |
1243 |
| - | |
1244 |
| - | |
1245 |
| - | |
1246 |
| - | |
1247 |
| - | |
1248 |
| - | |
1249 |
| - | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
1250 | 1240 |
| |
1251 | 1241 |
| |
1252 | 1242 |
| |
| |||
1989 | 1979 |
| |
1990 | 1980 |
| |
1991 | 1981 |
| |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
1992 | 2008 |
| |
1993 | 2009 |
| |
1994 | 2010 |
| |
|
Lines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1642 | 1642 |
| |
1643 | 1643 |
| |
1644 | 1644 |
| |
1645 |
| - | |
1646 |
| - | |
1647 |
| - | |
1648 |
| - | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
1649 | 1649 |
| |
1650 | 1650 |
| |
1651 | 1651 |
| |
| |||
1865 | 1865 |
| |
1866 | 1866 |
| |
1867 | 1867 |
| |
1868 |
| - | |
1869 | 1868 |
| |
| 1869 | + | |
| 1870 | + | |
1870 | 1871 |
| |
1871 | 1872 |
| |
1872 | 1873 |
| |
1873 |
| - | |
1874 | 1874 |
| |
1875 | 1875 |
| |
1876 | 1876 |
| |
| |||
2461 | 2461 |
| |
2462 | 2462 |
| |
2463 | 2463 |
| |
2464 |
| - | |
2465 | 2464 |
| |
| 2465 | + | |
| 2466 | + | |
2466 | 2467 |
| |
2467 | 2468 |
| |
2468 | 2469 |
| |
2469 |
| - | |
2470 | 2470 |
| |
2471 | 2471 |
| |
2472 | 2472 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1610 | 1610 |
| |
1611 | 1611 |
| |
1612 | 1612 |
| |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
1613 | 1622 |
| |
1614 | 1623 |
| |
1615 | 1624 |
| |
| |||
3872 | 3881 |
| |
3873 | 3882 |
| |
3874 | 3883 |
| |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
3875 | 3887 |
| |
3876 | 3888 |
| |
3877 | 3889 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1202 | 1202 |
| |
1203 | 1203 |
| |
1204 | 1204 |
| |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1205 | 1219 |
| |
1206 | 1220 |
| |
1207 | 1221 |
| |
| |||
2517 | 2531 |
| |
2518 | 2532 |
| |
2519 | 2533 |
| |
| 2534 | + | |
| 2535 | + | |
2520 | 2536 |
| |
2521 | 2537 |
| |
2522 | 2538 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3627 | 3627 |
| |
3628 | 3628 |
| |
3629 | 3629 |
| |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
3630 | 3639 |
| |
3631 | 3640 |
| |
3632 | 3641 |
| |
|
Lines changed: 22 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
902 | 902 |
| |
903 | 903 |
| |
904 | 904 |
| |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
905 | 911 |
| |
906 | 912 |
| |
907 | 913 |
| |
| |||
969 | 975 |
| |
970 | 976 |
| |
971 | 977 |
| |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
972 | 984 |
| |
973 | 985 |
| |
974 | 986 |
| |
| |||
1019 | 1031 |
| |
1020 | 1032 |
| |
1021 | 1033 |
| |
| 1034 | + | |
| 1035 | + | |
1022 | 1036 |
| |
1023 | 1037 |
| |
1024 | 1038 |
| |
| |||
1146 | 1160 |
| |
1147 | 1161 |
| |
1148 | 1162 |
| |
1149 |
| - | |
| 1163 | + | |
1150 | 1164 |
| |
1151 | 1165 |
| |
1152 | 1166 |
| |
1153 | 1167 |
| |
1154 | 1168 |
| |
1155 | 1169 |
| |
1156 | 1170 |
| |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1157 | 1177 |
| |
1158 | 1178 |
| |
1159 | 1179 |
| |
| |||
1495 | 1515 |
| |
1496 | 1516 |
| |
1497 | 1517 |
| |
| 1518 | + | |
1498 | 1519 |
| |
1499 | 1520 |
| |
1500 | 1521 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7283 | 7283 |
| |
7284 | 7284 |
| |
7285 | 7285 |
| |
| 7286 | + | |
7286 | 7287 |
| |
7287 | 7288 |
| |
7288 | 7289 |
| |
| |||
8612 | 8613 |
| |
8613 | 8614 |
| |
8614 | 8615 |
| |
| 8616 | + | |
| 8617 | + | |
| 8618 | + | |
| 8619 | + | |
| 8620 | + | |
| 8621 | + | |
| 8622 | + | |
| 8623 | + | |
| 8624 | + | |
| 8625 | + | |
| 8626 | + | |
| 8627 | + | |
| 8628 | + | |
| 8629 | + | |
| 8630 | + | |
| 8631 | + | |
8615 | 8632 |
| |
8616 | 8633 |
| |
8617 | 8634 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
362 | 362 |
| |
363 | 363 |
| |
364 | 364 |
| |
365 |
| - | |
| 365 | + | |
366 | 366 |
| |
367 | 367 |
| |
368 | 368 |
| |
| |||
615 | 615 |
| |
616 | 616 |
| |
617 | 617 |
| |
| 618 | + | |
618 | 619 |
| |
619 | 620 |
| |
620 | 621 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| 186 | + | |
186 | 187 |
| |
187 | 188 |
| |
188 | 189 |
| |
189 | 190 |
| |
190 | 191 |
| |
191 | 192 |
| |
192 | 193 |
| |
193 |
| - | |
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
|
Lines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1279 | 1279 |
| |
1280 | 1280 |
| |
1281 | 1281 |
| |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1282 | 1296 |
| |
1283 | 1297 |
| |
1284 | 1298 |
| |
| |||
1294 | 1308 |
| |
1295 | 1309 |
| |
1296 | 1310 |
| |
1297 |
| - | |
1298 |
| - | |
1299 |
| - | |
1300 |
| - | |
1301 |
| - | |
1302 |
| - | |
1303 |
| - | |
1304 |
| - | |
1305 |
| - | |
1306 |
| - | |
1307 |
| - | |
1308 |
| - | |
1309 |
| - | |
1310 |
| - | |
1311 | 1311 |
| |
1312 | 1312 |
| |
1313 | 1313 |
| |
|
0 commit comments
Comments
(0)