924{
929 int wfuncno;
931
932
933
934
935
936
937
938
939
940
941
943{
947
948
949
950
951
952
954
955
956
957
958
959
961
962
963
964
965
966
969
970
971
972
973
976
977
978
979
980
982
983
984
985
986
987
988
989
991
992
993
994
995
996
997
999
1000
1001
1002
1003
1004
1007
1008
1009
1010
1011
1013{
1021
1032
1035
1042
1043
1044
1045
1046
1047
1048
1049
1051{
1055
1057{
1064
1065
1066
1067
1068
1069
1070
1072{
1073
1075
1076
1078
1079
1081
1082
1084
1085
1086
1087
1088
1089
1090
1091
1092
1094
1095
1097
1098
1099
1100
1101
1104
1105
1106
1107
1108
1109
1111
1112
1113
1114
1115
1116
1117
1119
1120
1121
1122
1123
1125
1126
1127
1128
1129
1130
1131
1132
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1154
1155
1156
1157
1158
1159
1160
1161
1163{
1165
1167
1169
1171
1172
1173
1176
1177
1180
1181
1183
1184
1185
1186
1187
1188
1192
1194
1196
1197
1198
1199
1201
1202
1203
1204
1209
1211
1212
1213
1214
1215
1216
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1255
1256
1257
1258
1259
1260
1261
1262
1263#define innerPlanState(node) (((PlanState *)(node))->righttree)
1264#define outerPlanState(node) (((PlanState *)(node))->lefttree)
1265
1266
1267#define InstrCountTuples2(node, delta) \
1268 do { \
1269 if (((PlanState *)(node))->instrument) \
1270 ((PlanState *)(node))->instrument->ntuples2 += (delta); \
1271 } while (0)
1272#define InstrCountFiltered1(node, delta) \
1273 do { \
1274 if (((PlanState *)(node))->instrument) \
1275 ((PlanState *)(node))->instrument->nfiltered1 += (delta); \
1276 } while(0)
1277#define InstrCountFiltered2(node, delta) \
1278 do { \
1279 if (((PlanState *)(node))->instrument) \
1280 ((PlanState *)(node))->instrument->nfiltered2 += (delta); \
1281 } while(0)
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1302{
1303
1305 int epqParam;
1306 List *resultRelations;
1307
1308
1309
1310
1311
1312
1313
1316
1317
1318
1319
1320
1321
1324
1325
1326
1327
1328
1329
1330
1332
1333
1334
1335
1337
1338
1339
1340
1341
1342
1344
1345
1346
1347
1348
1349
1350 bool *relsubs_done;
1351
1352
1353
1354
1355
1356
1357
1358
1359 bool *relsubs_blocked;
1360
1363
1364
1365
1366
1367
1368
1370{
1373 bool rs_done;
1374 bool rs_checkqual;
1376
1377
1378
1379
1380
1381
1382
1383
1385{
1389 int nelems;
1390 bool pending_srf_tuples;
1393
1394
1395
1396#define MERGE_INSERT 0x01
1397#define MERGE_UPDATE 0x02
1398#define MERGE_DELETE 0x04
1399
1400
1401
1402
1403
1405{
1408 bool canSetTag;
1409 bool mt_done;
1410 int mt_nrels;
1412
1413
1414
1415
1416
1417
1418
1420
1423
1424
1425
1426
1427
1428
1429
1430 int mt_resultOidAttno;
1431 Oid mt_lastResultOid;
1432 int mt_lastResultIndex;
1433 HTAB *mt_resultOidHash;
1434
1435
1436
1437
1438
1440
1441
1443
1444
1446
1447
1449
1450
1451 int mt_merge_subcommands;
1452
1453
1455
1456
1457
1458
1459
1460
1462
1463
1464 double mt_merge_inserted;
1465 double mt_merge_updated;
1466 double mt_merge_deleted;
1467
1468
1469
1470
1471
1472
1473 List *mt_updateColnosLists;
1474 List *mt_mergeActionLists;
1475 List *mt_mergeJoinConditions;
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1496
1498{
1501 int as_nplans;
1502 int as_whichplan;
1503 bool as_begun;
1505 int as_nasyncplans;
1508 int as_nasyncresults;
1509 bool as_syncdone;
1510
1511 int as_nasyncremain;
1514
1515 int as_first_partial_plan;
1516
1520 bool as_valid_subplans_identified;
1524};
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1542{
1545 int ms_nplans;
1546 int ms_nkeys;
1550 bool ms_initialized;
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1567{
1569 bool recursing;
1570 bool intermediate_empty;
1573
1580
1581
1582
1583
1584
1586{
1589 int nplans;
1591
1592
1593
1594
1595
1597{
1600 int nplans;
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1623{
1629
1630
1631
1632
1633
1635{
1639
1640
1641
1642
1643
1645{
1649
1651 void *tsm_state;
1652 bool use_bulkread;
1653 bool use_pagemode;
1654 bool begun;
1657 bool haveblock;
1658 bool done;
1660
1661
1662
1663
1664
1665
1666typedef struct
1667{
1670 bool key_toastable;
1672
1673typedef struct
1674{
1677 int next_elem;
1678 int num_elems;
1680 bool *elem_nulls;
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1712{
1715 List *indexorderbyorig;
1717 int iss_NumScanKeys;
1719 int iss_NumOrderByKeys;
1721 int iss_NumRuntimeKeys;
1722 bool iss_RuntimeKeysReady;
1728
1729
1731 bool iss_ReachedEnd;
1732 Datum *iss_OrderByValues;
1733 bool *iss_OrderByNulls;
1735 bool *iss_OrderByTypByVals;
1736 int16 *iss_OrderByTypLens;
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1764{
1768 int ioss_NumScanKeys;
1770 int ioss_NumOrderByKeys;
1772 int ioss_NumRuntimeKeys;
1773 bool ioss_RuntimeKeysReady;
1783 int ioss_NameCStringCount;
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1805{
1809 int biss_NumScanKeys;
1811 int biss_NumRuntimeKeys;
1813 int biss_NumArrayKeys;
1814 bool biss_RuntimeKeysReady;
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835typedef enum
1836{
1841
1842
1843
1844
1845
1846
1847
1848
1849
1851{
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1871{
1879 bool recheck;
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1893{
1896 bool tss_isCurrentOf;
1897 int tss_NumTids;
1898 int tss_TidPtr;
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1913{
1915 List *trss_tidexprs;
1918 bool trss_inScan;
1921
1922
1923
1924
1925
1926
1927
1928
1930{
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1952
1954{
1956 int eflags;
1957 bool ordinality;
1958 bool simple;
1960 int nfuncs;
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1990{
1994 List **exprstatelists;
1995 int array_len;
1996 int curr_idx;
1998
1999
2000
2001
2002
2003
2004
2006{
2013 List *passingvalexprs;
2017 void *opaque;
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2037{
2039 int eflags;
2040 int readptr;
2042
2044
2046 bool eof_cte;
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2060{
2062 int readptr;
2066
2067
2068
2069
2070
2071
2072
2073
2074
2076{
2080
2081
2082
2083
2084
2085
2086
2088{
2093
2095 void *fdw_state;
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2112
2114{
2117
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2136{
2139 bool single_match;
2140
2143
2144
2145
2146
2147
2148
2149
2150
2151
2153{
2155 bool nl_NeedNewOuter;
2156 bool nl_MatchedOuter;
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2184
2186{
2188 int mj_NumClauses;
2190 int mj_JoinState;
2191 bool mj_SkipMarkRestore;
2192 bool mj_ExtraMarks;
2193 bool mj_ConstFalseJoin;
2194 bool mj_FillOuter;
2195 bool mj_FillInner;
2196 bool mj_MatchedOuter;
2197 bool mj_MatchedInner;
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2236
2238{
2244 int hj_CurBucketNo;
2245 int hj_CurSkewBucketNo;
2252 int hj_JoinState;
2253 bool hj_MatchedOuter;
2254 bool hj_OuterNotEmpty;
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2273{
2275 int eflags;
2276 bool eof_underlying;
2279
2283
2284
2285
2286
2287
2288
2289
2290
2292{
2294 int mstatus;
2295 int nkeys;
2302
2310
2311
2312
2314
2315 bool singlerow;
2316
2317 bool binary_mode;
2318
2322
2324
2325
2326
2327
2328
2329
2330
2331
2333{
2338
2339
2340
2341
2342
2344{
2346 bool randomAccess;
2347 bool bounded;
2349 bool sort_Done;
2350 bool bounded_Done;
2352 void *tuplesortstate;
2353 bool am_worker;
2354 bool datumSort;
2357
2358typedef enum
2359{
2365
2367{
2369 bool bounded;
2371 bool outerNodeDone;
2374 int64 n_fullsort_remaining;
2377
2379
2381
2382
2385 bool am_worker;
2388
2389
2390
2391
2392
2394{
2397 bool grp_done;
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2418
2420{
2423 int numaggs;
2424 int numtrans;
2428 int numphases;
2429 int current_phase;
2435#define FIELDNO_AGGSTATE_CURAGGCONTEXT 14
2438#define FIELDNO_AGGSTATE_CURPERTRANS 16
2440 bool input_done;
2441 bool agg_done;
2442 int projected_set;
2443#define FIELDNO_AGGSTATE_CURRENT_SET 20
2444 int current_set;
2446 List *all_grouped_cols;
2448 int max_colno_needed;
2449 bool all_cols_needed;
2450
2451 int maxsets;
2456
2458
2460
2461 bool table_filled;
2462 int num_hashes;
2467
2471 bool hash_ever_spilled;
2472 bool hash_spill_mode;
2473
2474 Size hash_mem_limit;
2475 uint64 hash_ngroups_limit;
2476 int hash_planned_partitions;
2477
2478 double hashentrysize;
2480 uint64 hash_ngroups_current;
2481
2483 int hash_batches_used;
2484
2487
2488
2489
2490#define FIELDNO_AGGSTATE_ALL_PERGROUPS 54
2492
2495
2496
2497
2498
2499
2500
2503
2504
2505
2506
2508{
2513
2515
2517{
2519
2520
2522 int numfuncs;
2523 int numaggs;
2524
2530 int current_ptr;
2531 int framehead_ptr;
2532 int frametail_ptr;
2533 int grouptail_ptr;
2538
2540 int64 aggregatedbase;
2541 int64 aggregatedupto;
2543
2544 int frameOptions;
2547 Datum startOffsetValue;
2548 Datum endOffsetValue;
2549
2550
2554 bool inRangeAsc;
2555 bool inRangeNullsFirst;
2556
2557
2558 bool use_pass_through;
2559
2560
2561 bool top_window;
2562
2564
2565
2566
2567
2568
2570 int64 frameheadgroup;
2571 int64 frametailgroup;
2574
2579
2580 bool all_first;
2581 bool partition_spooled;
2582
2583 bool next_partition;
2584 bool more_partitions;
2585
2586 bool framehead_valid;
2587
2588 bool frametail_valid;
2589
2590 bool grouptail_valid;
2591
2592
2594
2597
2598
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2616{
2620
2621
2622
2623
2624
2625
2626
2627
2629{
2632 bool need_to_scan_locally;
2633 int64 tuples_needed;
2634
2637
2638 int nworkers_launched;
2639 int nreaders;
2640 int nextreader;
2643
2644
2645
2646
2647
2648
2649
2650
2651
2653
2655{
2658 bool gm_initialized;
2659 bool need_to_scan_locally;
2660 int64 tuples_needed;
2661
2663 int gm_nkeys;
2666
2667
2668 int nworkers_launched;
2669 int nreaders;
2675
2676
2677
2678
2679
2681{
2685
2688
2689
2690
2691
2692
2693
2694
2696
2697
2698
2699
2700
2701
2703
2704
2707
2708
2709
2710
2711
2712
2713
2714
2716{
2720 bool needGroup;
2722
2724{
2726 bool setop_done;
2728 int numCols;
2729
2730
2734 bool need_init;
2735
2736
2741 bool table_filled;
2744
2745
2746
2747
2748
2749
2750
2752{
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770typedef enum
2771{
2781
2783{
2790 bool noCount;
2795
2798
2799#endif
struct WindowStatePerAggData * WindowStatePerAgg
IncrementalSortExecutionStatus
@ WINDOWAGG_PASSTHROUGH_STRICT
struct HashJoinTableData * HashJoinTable
struct HashJoinTupleData * HashJoinTuple
struct WindowStatePerFuncData * WindowStatePerFunc
struct AggStatePerHashData * AggStatePerHash
struct MergeJoinClauseData * MergeJoinClause
struct AggStatePerGroupData * AggStatePerGroup
struct AggStatePerPhaseData * AggStatePerPhase
struct AggStatePerTransData * AggStatePerTrans
tuplehash_iterator TupleHashIterator
struct AggStatePerAggData * AggStatePerAgg
TupleTableSlot *(* ExecProcNodeMtd)(PlanState *pstate)
static void fireBSTriggers(ModifyTableState *node)
#define pg_node_attr(...)
DomainConstraintType constrainttype
ExprState * check_exprstate
FunctionCallInfo input_fcinfo
ErrorSaveContext escontext
NullableDatum formatted_expr
const TupleTableSlotOps * resultops
struct SharedJitInstrumentation * worker_jit_instrument
Instrumentation * instrument
ExecProcNodeMtd ExecProcNodeReal
const TupleTableSlotOps * outerops
const TupleTableSlotOps * innerops
const TupleTableSlotOps * scanops
TupleDesc ps_ResultTupleDesc
WorkerInstrumentation * worker_instrument
ExprContext * ps_ExprContext
TupleTableSlot * ps_ResultTupleSlot
ProjectionInfo * ps_ProjInfo
ExecProcNodeMtd ExecProcNode
TupleTableSlot * funcResultSlot
Tuplestorestate * funcResultStore
ExprState * elidedFuncState
ExprState * lhs_hash_expr
ExprContext * innerecontext
FmgrInfo * tab_hash_funcs
ProjectionInfo * projLeft
ProjectionInfo * projRight
MemoryContext tuplesContext