1714{
1716
1718
1721 bool em_is_const;
1722 bool em_is_child;
1725
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778typedef struct
1779{
1781 int current_relid;
1782
1783
1785
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1806{
1808
1810
1811
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1828{
1830
1834
1835
1836
1837
1838
1839
1841{
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1871{
1873
1875
1876
1878
1879
1881
1882
1884
1885
1887
1888
1891
1892
1893#define get_pathtarget_sortgroupref(target, colno) \
1894 ((target)->sortgrouprefs ? (target)->sortgrouprefs[colno] : (Index) 0)
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1918{
1920
1922
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1964{
1966
1968
1969
1971
1972
1973
1974
1975
1976
1977
1979
1980
1981
1982
1983
1984
1986
1987
1988
1989
1990
1991
1992
1993
1995
1996
1998
2000
2002
2003
2008
2009
2012
2013
2014#define PATH_REQ_OUTER(path) \
2015 ((path)->param_info ? (path)->param_info->ppi_req_outer : (Relids) NULL)
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2053{
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2099{
2101
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2128{
2132
2133
2134
2135
2136
2137
2138
2140{
2145
2146
2147
2148
2149
2150
2151
2153{
2158
2159
2160
2161
2162
2163
2164
2165
2167{
2171
2172
2173
2174
2175
2176
2177
2179{
2183
2184
2185
2186
2187
2188
2189
2190
2191
2193{
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2213{
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2247
2249{
2252
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2281{
2284
2289
2290#define IS_DUMMY_APPEND(p) \
2291 (IsA((p), AppendPath) && ((AppendPath *) (p))->subpaths == NIL)
2292
2293
2294
2295
2296
2297
2298#define IS_DUMMY_REL(r) is_dummy_rel(r)
2300
2301
2302
2303
2304
2305
2306
2308{
2314
2315
2316
2317
2318
2319
2320
2321
2323{
2327
2328
2329
2330
2331
2332
2333
2335{
2339
2340
2341
2342
2343
2344
2346{
2352
2354
2356
2357
2362
2363
2364
2365
2366
2367
2369{
2375
2376
2377
2378
2379
2381{
2386
2387
2388
2389
2390
2391
2393{
2395
2397
2399
2401
2402
2405
2407
2408
2409
2410
2411
2412
2414
2415
2416
2417
2418
2420{
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2466{
2468 List *path_mergeclauses;
2469 List *outersortkeys;
2470 List *innersortkeys;
2471 int outer_presorted_keys;
2472
2473 bool skip_mark_restore;
2474 bool materialize_inner;
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2487{
2489 List *path_hashclauses;
2490 int num_batches;
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2509{
2512 bool dummypp;
2514
2515
2516
2517
2518
2519
2521{
2525
2526
2527
2528
2529
2530
2531
2532
2533
2535{
2539
2540
2541
2542
2543
2544
2545
2547{
2549 int nPresortedCols;
2551
2552
2553
2554
2555
2556
2557
2558
2559
2561{
2567
2568
2569
2570
2571
2572
2573
2575{
2578 int numkeys;
2580
2581
2582
2583
2584
2585
2586
2587
2589{
2599
2600
2601
2602
2603
2605{
2607
2612
2614{
2616
2622 bool hashable;
2623 bool is_hashed;
2625
2626
2627
2628
2629
2631{
2639
2640
2641
2642
2644{
2649
2650
2651
2652
2654{
2660 bool topwindow;
2661
2663
2664
2665
2666
2668{
2677
2678
2679
2680
2682{
2687 int wtParam;
2690
2691
2692
2693
2695{
2699 int epqParam;
2701
2702
2703
2704
2705
2706
2707
2708
2710{
2714 bool canSetTag;
2715 Index nominalRelation;
2717 List *resultRelations;
2718 List *updateColnosLists;
2719 List *withCheckOptionLists;
2720 List *returningLists;
2724 int epqParam;
2725 List *mergeActionLists;
2726
2727 List *mergeJoinConditions;
2728
2730
2731
2732
2733
2735{
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2894{
2896
2898
2899
2901
2902
2903 bool is_pushed_down;
2904
2905
2907
2908
2910
2911
2912 bool has_clone;
2913 bool is_clone;
2914
2915
2917
2918
2920
2921
2922 Index security_level;
2923
2924
2926
2927
2929
2930
2932
2933
2934 Relids incompatible_relids;
2935
2936
2938
2939
2940
2941
2942
2945
2946
2947
2948
2949
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972 int rinfo_serial;
2973
2974
2975
2976
2977
2979
2980
2981
2982
2983
2984
2986
2987
2989
2991
2992
2993
2994
2995
2997
2998
2999
3000
3001
3002
3004
3006
3008
3010
3011
3012
3013
3014
3015
3017
3018
3019
3020
3021
3023
3024
3025
3026
3027
3029
3030
3031
3032
3033
3035
3037
3039
3041
3042
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057#define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids) \
3058 ((rinfo)->is_pushed_down || \
3059 !bms_is_subset((rinfo)->required_relids, joinrelids))
3060
3061
3062
3063
3064
3065
3066
3067
3069{
3070
3074 bool nulls_first;
3075
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3115{
3117
3119
3120
3122
3123
3125
3126
3128
3129
3131
3132
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3221{
3223
3235 bool lhs_strict;
3236
3237 bool semi_can_btree;
3238 bool semi_can_hash;
3239 List *semi_operators;
3240 List *semi_rhs_exprs;
3242
3243
3244
3245
3246
3247
3248
3250{
3252
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3289{
3291
3293
3294
3295
3296
3297
3298
3299
3302
3303
3304
3305
3306
3307
3308
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328 List *translated_vars;
3329
3330
3331
3332
3333
3334
3335
3336 int num_child_cols;
3338
3339
3340
3341
3342
3343
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3366{
3368
3370
3373 char *rowidname;
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3404{
3406
3408
3409
3411
3412
3413
3414
3415
3417
3418
3420
3421
3423
3424
3426
3427
3430
3431
3432
3433
3434
3435
3437{
3439
3441
3442
3444
3445
3447
3448
3450
3451
3452
3453
3454
3456
3457
3459
3460
3462
3463
3466
3467
3468
3469
3470
3471
3472
3473
3475{
3477
3479
3480
3482
3483
3486
3487
3488
3489
3490
3491
3492
3493
3495{
3497
3499
3500
3502
3503
3505
3506
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3558{
3560
3562
3564 int paramId;
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3584{
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3604{
3606 List *mergeclause_list;
3607 bool inner_unique;
3610 Relids param_source_rels;
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629#define GROUPING_CAN_USE_SORT 0x0001
3630#define GROUPING_CAN_USE_HASH 0x0002
3631#define GROUPING_CAN_PARTIAL_AGG 0x0004
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644typedef enum
3645{
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664typedef struct
3665{
3666
3667 int flags;
3668 bool partial_costs_set;
3671
3672
3673 bool target_parallel_safe;
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689typedef struct
3690{
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3710{
3711
3712 int disabled_nodes;
3715
3716
3718
3719
3720 Cost inner_run_cost;
3721 Cost inner_rescan_run_cost;
3722
3723
3728
3729
3730 int numbuckets;
3731 int numbatches;
3734
3735
3736
3737
3738
3739
3741{
3743
3745
3746
3747
3748
3749
3750
3751
3753
3754
3755 int transno;
3756
3757
3758
3759
3760
3761 bool shareable;
3762
3763
3766
3767
3768
3769
3770
3771
3772
3773
3775{
3777
3779
3780
3783
3784
3786
3787
3789
3790
3792
3793
3795
3796
3798
3799
3800 int32 aggtranstypmod;
3801 int transtypeLen;
3802 bool transtypeByVal;
3803
3804
3805 int32 aggtransspace;
3806
3807
3809 bool initValueIsNull;
3811
3812
3813
3814
3815
3817{
3819
3821
3822
3823
3824
3825
3827
3828
3829
3830
3831
3832 bool self_join;
3833
3834
3835
3836
3837
3838
3839
3840 List *extra_clauses;
3842
3843#endif
static DataChecksumsWorkerOperation operation
Datum subpath(PG_FUNCTION_ARGS)
#define pg_node_attr(...)
bool is_dummy_rel(RelOptInfo *rel)
PartitionwiseAggregateType
@ PARTITIONWISE_AGGREGATE_PARTIAL
@ PARTITIONWISE_AGGREGATE_FULL
@ PARTITIONWISE_AGGREGATE_NONE
bool limit_needed(Query *parse)
List * child_append_relid_sets
Selectivity bitmapselectivity
Selectivity bitmapselectivity
const struct CustomPathMethods * methods
List * custom_restrictinfo
struct RestrictInfo * rinfo
ScanDirection indexscandir
Selectivity indexselectivity
Cardinality est_unique_keys
List * child_append_relid_sets
VolatileFunctionStatus has_volatile_expr