-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathguc_gp.c
More file actions
5852 lines (5334 loc) · 156 KB
/
guc_gp.c
File metadata and controls
5852 lines (5334 loc) · 156 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*--------------------------------------------------------------------
* guc_gp.c
*
* Additional Cloudberry-specific GUCs are defined in this file, to
* avoid adding so much stuff to guc.c. This makes it easier to diff
* and merge with upstream.
*
* Portions Copyright (c) 2005-2010, Greenplum inc
* Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/utils/misc/guc_gp.c
*
*--------------------------------------------------------------------
*/
#include "postgres.h"
#include <float.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#include "access/reloptions.h"
#include "access/transam.h"
#include "access/url.h"
#include "access/xlog_internal.h"
#include "cdb/cdbappendonlyam.h"
#include "cdb/cdbendpoint.h"
#include "cdb/cdbdisp.h"
#include "cdb/cdbdisp_query.h"
#include "cdb/cdbhash.h"
#include "cdb/cdbsreh.h"
#include "cdb/cdbvars.h"
#include "cdb/cdbutil.h"
#include "cdb/memquota.h"
#include "cdb/ml_ipc.h"
#include "commands/defrem.h"
#include "commands/vacuum.h"
#include "commands/variable.h"
#include "miscadmin.h"
#include "optimizer/cost.h"
#include "optimizer/planmain.h"
#include "pgstat.h"
#include "parser/scansup.h"
#include "postmaster/syslogger.h"
#include "postmaster/fts.h"
#include "postmaster/postmaster.h"
#include "replication/walsender.h"
#include "storage/proc.h"
#include "task/pg_cron.h"
#include "tcop/idle_resource_cleaner.h"
#include "utils/builtins.h"
#include "utils/gdd.h"
#include "utils/guc_tables.h"
#include "utils/inval.h"
#include "utils/resscheduler.h"
#include "utils/resgroup.h"
#include "utils/resource_manager.h"
#include "utils/varlena.h"
#include "utils/vmem_tracker.h"
#include "catalog/index.h"
/*
* These constants are copied from guc.c. They should not bitrot when we
* merge guc.c with upstream, as these are natural constants that never
* change. guc.c might acquire more of these, though. In that case, we'll
* just copy the new ones too, as needed.
*/
#define KB_PER_MB (1024)
#define KB_PER_GB (1024*1024)
#define MS_PER_S 1000
#define S_PER_MIN 60
#define MS_PER_MIN (1000 * 60)
#define MIN_PER_H 60
#define S_PER_H (60 * 60)
#define MS_PER_H (1000 * 60 * 60)
#define MIN_PER_D (60 * 24)
#define S_PER_D (60 * 60 * 24)
#define MS_PER_D (1000 * 60 * 60 * 24)
/*
* Assign/Show hook functions defined in this module
*/
static bool check_optimizer(bool *newval, void **extra, GucSource source);
static bool check_verify_gpfdists_cert(bool *newval, void **extra, GucSource source);
static bool check_dispatch_log_stats(bool *newval, void **extra, GucSource source);
static bool check_gp_workfile_compression(bool *newval, void **extra, GucSource source);
static bool check_hot_dr(bool *newval, void **extra, GucSource source);
/* Helper function for guc setter */
bool gpvars_check_gp_resqueue_priority_default_value(char **newval,
void **extra,
GucSource source);
static bool check_gp_default_storage_options(char **newval, void **extra, GucSource source);
static void assign_gp_default_storage_options(const char *newval, void *extra);
static bool check_pljava_classpath_insecure(bool *newval, void **extra, GucSource source);
static void assign_pljava_classpath_insecure(bool newval, void *extra);
static bool check_gp_resource_group_bypass(bool *newval, void **extra, GucSource source);
static int guc_array_compare(const void *a, const void *b);
static bool check_max_running_tasks(int *newval, void **extra, GucSource source);
static bool check_gp_interconnect_type(char **newval, void **extra, GucSource source);
static void assign_gp_interconnect_type(const char *newval, void *extra);
static const char *show_gp_interconnect_type(void);
int listenerBacklog = 128;
/* For synchornized GUC value is cache in HashTable,
* dispatch value along with query when some guc changed
*/
List *gp_guc_restore_list = NIL;
bool gp_guc_need_restore = false;
char *Debug_dtm_action_sql_command_tag;
bool Debug_shareinput_xslice = false;
bool Debug_print_full_dtm = false;
bool Debug_print_snapshot_dtm = false;
bool Debug_disable_distributed_snapshot = false;
bool Debug_abort_after_distributed_prepared = false;
bool Debug_appendonly_print_insert = false;
bool Debug_appendonly_print_insert_tuple = false;
bool Debug_appendonly_print_scan = false;
bool Debug_appendonly_print_scan_tuple = false;
bool Debug_appendonly_print_delete = false;
bool Debug_appendonly_print_storage_headers = false;
bool Debug_appendonly_print_verify_write_block = false;
bool Debug_appendonly_use_no_toast = false;
bool Debug_appendonly_print_blockdirectory = false;
bool Debug_appendonly_print_read_block = false;
bool Debug_appendonly_print_append_block = false;
bool Debug_appendonly_print_segfile_choice = false;
bool test_AppendOnlyHash_eviction_vs_just_marking_not_inuse = false;
bool Debug_appendonly_print_datumstream = false;
bool Debug_appendonly_print_visimap = false;
bool Debug_appendonly_print_compaction = false;
bool Debug_bitmap_print_insert = false;
bool Test_print_direct_dispatch_info = false;
bool Test_print_prefetch_joinqual = false;
bool Test_copy_qd_qe_split = false;
bool gp_permit_relation_node_change = false;
int gp_max_local_distributed_cache = 1024;
bool gp_appendonly_verify_block_checksums = true;
bool gp_appendonly_verify_write_block = false;
bool gp_appendonly_compaction = true;
int gp_appendonly_compaction_threshold = 0;
bool enable_parallel = false;
bool enable_parallel_semi_join = true;
bool enable_parallel_dedup_semi_join = true;
bool enable_parallel_dedup_semi_reverse_join = true;
bool parallel_query_use_streaming_hashagg = false;
bool gp_use_streaming_hashagg = true;
int gp_appendonly_insert_files = 0;
int gp_appendonly_insert_files_tuples_range = 0;
int gp_random_insert_segments = 0;
int gp_appendonly_compaction_segfile_limit = 0;
bool gp_heap_require_relhasoids_match = true;
bool gp_local_distributed_cache_stats = false;
bool debug_xlog_record_read = false;
bool Debug_cancel_print = false;
bool Debug_datumstream_write_print_small_varlena_info = false;
bool Debug_datumstream_write_print_large_varlena_info = false;
bool Debug_datumstream_read_check_large_varlena_integrity = false;
bool Debug_datumstream_block_read_check_integrity = false;
bool Debug_datumstream_block_write_check_integrity = false;
bool Debug_datumstream_read_print_varlena_info = false;
bool Debug_datumstream_write_use_small_initial_buffers = false;
bool gp_create_table_random_default_distribution = true;
bool gp_allow_non_uniform_partitioning_ddl = true;
bool gp_print_create_gang_time = false;
int dtx_phase2_retry_second = 0;
bool gp_log_suboverflow_statement = false;
bool log_dispatch_stats = false;
int explain_memory_verbosity = 0;
char *memory_profiler_run_id = "none";
char *memory_profiler_dataset_id = "none";
char *memory_profiler_query_id = "none";
int memory_profiler_dataset_size = 0;
/* WAL based replication debug GUCs */
bool debug_walrepl_snd = false;
bool debug_walrepl_syncrep = false;
bool debug_walrepl_rcv = false;
bool debug_basebackup = false;
int rep_lag_avoidance_threshold = 0;
#define DEBUG_DTM_ACTION_PRIMARY_DEFAULT true
bool Debug_dtm_action_primary = DEBUG_DTM_ACTION_PRIMARY_DEFAULT;
bool gp_log_optimization_time = false;
int Debug_dtm_action = DEBUG_DTM_ACTION_NONE;
#define DEBUG_DTM_ACTION_TARGET_DEFAULT DEBUG_DTM_ACTION_TARGET_NONE
int Debug_dtm_action_target = DEBUG_DTM_ACTION_TARGET_DEFAULT;
#define DEBUG_DTM_ACTION_PROTOCOL_DEFAULT DTX_PROTOCOL_COMMAND_COMMIT_PREPARED
int Debug_dtm_action_protocol = DEBUG_DTM_ACTION_PROTOCOL_DEFAULT;
#define DEBUG_DTM_ACTION_SEGMENT_DEFAULT -2
#define DEBUG_DTM_ACTION_NESTINGLEVEL_DEFAULT 0
int Debug_dtm_action_segment = DEBUG_DTM_ACTION_SEGMENT_DEFAULT;
int Debug_dtm_action_nestinglevel = DEBUG_DTM_ACTION_NESTINGLEVEL_DEFAULT;
int gp_connection_send_timeout;
bool create_restartpoint_on_ckpt_record_replay = false;
/*
* This variable is a dummy that doesn't do anything, except in some
* cases provide the value for SHOW to display. The real state is elsewhere
* and is kept in sync by assign_hooks.
*/
static char *gp_resource_manager_str;
/* Backoff-related GUCs */
bool gp_enable_resqueue_priority;
int gp_resqueue_priority_local_interval;
int gp_resqueue_priority_sweeper_interval;
int gp_resqueue_priority_inactivity_timeout;
int gp_resqueue_priority_grouping_timeout;
double gp_resqueue_priority_cpucores_per_segment;
char *gp_resqueue_priority_default_value;
bool gp_debug_resqueue_priority = false;
/* Resource group GUCs */
int gp_resource_group_cpu_priority;
double gp_resource_group_cpu_limit;
bool gp_resource_group_bypass;
bool gp_resource_group_bypass_catalog_query;
bool gp_resource_group_bypass_direct_dispatch;
char *gp_resource_group_cgroup_parent;
/* Metrics collector debug GUC */
bool vmem_process_interrupt = false;
bool execute_pruned_plan = false;
/* partitioning GUC */
int gp_max_partition_level;
/* Upgrade & maintenance GUCs */
bool gp_maintenance_mode;
bool gp_maintenance_conn;
bool allow_segment_DML;
bool gp_enable_statement_trigger;
/* Time based authentication GUC */
char *gp_auth_time_override_str = NULL;
/* include file/line information to stack traces */
bool gp_log_stack_trace_lines;
/* ignore INTO error-table clauses for backwards compatibility */
bool gp_ignore_error_table = false;
/*
* If set to true, we will silently insert into the correct leaf
* part even if the user specifies a wrong leaf part as a insert target
*/
bool dml_ignore_target_partition_check = false;
/* Planner gucs */
bool gp_enable_hashjoin_size_heuristic = false;
bool gp_enable_predicate_propagation = false;
bool gp_enable_minmax_optimization = true;
bool gp_enable_multiphase_agg = true;
bool gp_enable_multiphase_limit = true;
bool gp_enable_preunique = true;
bool gp_enable_agg_distinct = true;
bool gp_enable_dqa_pruning = true;
bool gp_enable_agg_pushdown = false;
bool gp_dynamic_partition_pruning = true;
bool gp_log_dynamic_partition_pruning = false;
bool gp_cte_sharing = false;
bool gp_enable_relsize_collection = false;
bool gp_recursive_cte = true;
bool gp_eager_two_phase_agg = false;
bool gp_eager_distinct_dedup = false;
bool gp_force_random_redistribution = false;
/* Optimizer related gucs */
bool optimizer;
bool optimizer_log;
int optimizer_log_failure;
bool optimizer_control = true;
bool optimizer_trace_fallback;
bool optimizer_partition_selection_log;
int optimizer_minidump;
int optimizer_cost_model;
bool optimizer_metadata_caching;
int optimizer_mdcache_size;
bool optimizer_use_gpdb_allocators;
/* Optimizer debugging GUCs */
bool optimizer_print_query;
bool optimizer_print_plan;
bool optimizer_print_xform;
bool optimizer_print_memo_after_exploration;
bool optimizer_print_memo_after_implementation;
bool optimizer_print_memo_after_optimization;
bool optimizer_print_job_scheduler;
bool optimizer_print_expression_properties;
bool optimizer_print_group_properties;
bool optimizer_print_optimization_context;
bool optimizer_print_optimization_stats;
bool optimizer_print_xform_results;
bool optimizer_print_preprocess_result;
bool optimizer_debug_cte;
/* array of xforms disable flags */
bool optimizer_xforms[OPTIMIZER_XFORMS_COUNT] = {[0 ... OPTIMIZER_XFORMS_COUNT - 1] = false};
char *optimizer_search_strategy_path = NULL;
/* GUCs to tell Optimizer to enable a physical operator */
bool optimizer_enable_nljoin;
bool optimizer_enable_indexjoin;
bool optimizer_enable_motions_masteronly_queries;
bool optimizer_enable_motions;
bool optimizer_enable_motion_broadcast;
bool optimizer_enable_motion_gather;
bool optimizer_enable_motion_redistribute;
bool optimizer_enable_sort;
bool optimizer_enable_materialize;
bool optimizer_enable_partition_propagation;
bool optimizer_enable_partition_selection;
bool optimizer_enable_outerjoin_rewrite;
bool optimizer_enable_multiple_distinct_aggs;
bool optimizer_enable_direct_dispatch;
bool optimizer_enable_hashjoin_redistribute_broadcast_children;
bool optimizer_enable_broadcast_nestloop_outer_child;
bool optimizer_discard_redistribute_hashjoin;
bool optimizer_enable_streaming_material;
bool optimizer_enable_gather_on_segment_for_dml;
bool optimizer_enable_assert_maxonerow;
bool optimizer_enable_constant_expression_evaluation;
bool optimizer_enable_bitmapscan;
bool optimizer_enable_outerjoin_to_unionall_rewrite;
bool optimizer_enable_ctas;
bool optimizer_enable_dml;
bool optimizer_enable_dml_constraints;
bool optimizer_enable_master_only_queries;
bool optimizer_enable_hashjoin;
bool optimizer_enable_dynamictablescan;
bool optimizer_enable_dynamicindexscan;
bool optimizer_enable_dynamicindexonlyscan;
bool optimizer_enable_dynamicbitmapscan;
bool optimizer_enable_indexscan;
bool optimizer_enable_indexonlyscan;
bool optimizer_enable_tablescan;
bool optimizer_enable_hashagg;
bool optimizer_enable_groupagg;
bool optimizer_expand_fulljoin;
bool optimizer_enable_mergejoin;
bool optimizer_enable_redistribute_nestloop_loj_inner_child;
bool optimizer_force_comprehensive_join_implementation;
bool optimizer_enable_replicated_table;
bool optimizer_enable_foreign_table;
bool optimizer_enable_right_outer_join;
bool optimizer_enable_query_parameter;
bool optimizer_force_window_hash_agg;
int optimizer_agg_pds_strategy;
/* Optimizer plan enumeration related GUCs */
bool optimizer_enumerate_plans;
bool optimizer_sample_plans;
int optimizer_plan_id;
int optimizer_samples_number;
/* Cardinality estimation related GUCs used by the Optimizer */
bool optimizer_extract_dxl_stats;
bool optimizer_extract_dxl_stats_all_nodes;
bool optimizer_print_missing_stats;
double optimizer_damping_factor_filter;
double optimizer_damping_factor_join;
double optimizer_damping_factor_groupby;
bool optimizer_dpe_stats;
bool optimizer_enable_derive_stats_all_groups;
/* Costing related GUCs used by the Optimizer */
int optimizer_segments;
int optimizer_penalize_broadcast_threshold;
double optimizer_cost_threshold;
double optimizer_nestloop_factor;
double optimizer_sort_factor;
double optimizer_spilling_mem_threshold;
/* Optimizer hints */
int optimizer_join_arity_for_associativity_commutativity;
int optimizer_array_expansion_threshold;
int optimizer_join_order_threshold;
int optimizer_join_order;
int optimizer_cte_inlining_bound;
int optimizer_push_group_by_below_setop_threshold;
int optimizer_xform_bind_threshold;
int optimizer_skew_factor;
bool optimizer_force_multistage_agg;
bool optimizer_force_three_stage_scalar_dqa;
bool optimizer_force_expanded_distinct_aggs;
bool optimizer_force_agg_skew_avoidance;
bool optimizer_force_split_window_function;
bool optimizer_penalize_skew;
bool optimizer_prune_computed_columns;
bool optimizer_push_requirements_from_consumer_to_producer;
bool optimizer_enforce_subplans;
bool optimizer_use_external_constant_expression_evaluation_for_ints;
bool optimizer_apply_left_outer_to_union_all_disregarding_stats;
bool optimizer_remove_order_below_dml;
bool optimizer_multilevel_partitioning;
bool optimizer_parallel_union;
bool optimizer_array_constraints;
bool optimizer_cte_inlining;
bool optimizer_enable_space_pruning;
bool optimizer_enable_associativity;
bool optimizer_enable_eageragg;
bool optimizer_enable_range_predicate_dpe;
bool optimizer_enable_use_distribution_in_dqa;
bool optimizer_enable_push_join_below_union_all;
bool optimizer_enable_orderedagg;
bool optimizer_disable_dynamic_table_scan;
/* Analyze related GUCs for Optimizer */
bool optimizer_analyze_root_partition;
bool optimizer_analyze_midlevel_partition;
/* GUCs for replicated table */
bool optimizer_replicated_table_insert;
/* GUCs for slice table*/
int gp_max_slices;
/* System Information */
static int gp_server_version_num;
static char *gp_server_version_string;
/* Query Metrics */
bool gp_enable_query_metrics = false;
int gp_instrument_shmem_size = 5120;
/* Security */
bool gp_reject_internal_tcp_conn = true;
/* copy */
bool gp_enable_segment_copy_checking = true;
/*
* Default storage options GUC. Value is comma-separated name=value
* pairs. E.g. "blocksize=32768,compresstype=none,checksum=true"
*/
char *gp_default_storage_options = NULL;
int writable_external_table_bufsize = 1024;
bool gp_external_enable_filter_pushdown = true;
/* Enable GDD */
bool gp_enable_global_deadlock_detector = false;
bool gp_enable_predicate_pushdown;
int gp_predicate_pushdown_sample_rows;
bool gp_enable_runtime_filter_pushdown;
bool enable_offload_entry_to_qe = false;
bool enable_answer_query_using_materialized_views = false;
bool aqumv_allow_foreign_table = false;
bool gp_log_endpoints = false;
/* optional reject to parse ambigous 5-digits date in YYYMMDD format */
bool gp_allow_date_field_width_5digits = false;
/* Avoid do a real REFRESH materialized view if possibile. */
bool gp_enable_refresh_fast_path = true;
static const struct config_enum_entry gp_log_format_options[] = {
{"text", 0},
{"csv", 1},
{NULL, 0}
};
static const struct config_enum_entry debug_dtm_action_protocol_options[] = {
{"none", DTX_PROTOCOL_COMMAND_NONE},
{"abort_no_prepared", DTX_PROTOCOL_COMMAND_ABORT_NO_PREPARED},
{"prepare", DTX_PROTOCOL_COMMAND_PREPARE},
{"abort_some_prepared", DTX_PROTOCOL_COMMAND_ABORT_SOME_PREPARED},
{"commit_onephase", DTX_PROTOCOL_COMMAND_COMMIT_ONEPHASE},
{"commit_prepared", DTX_PROTOCOL_COMMAND_COMMIT_PREPARED},
{"abort_prepared", DTX_PROTOCOL_COMMAND_ABORT_PREPARED},
{"retry_commit_prepared", DTX_PROTOCOL_COMMAND_RETRY_COMMIT_PREPARED},
{"retry_abort_prepared", DTX_PROTOCOL_COMMAND_RETRY_ABORT_PREPARED},
{"recovery_commit_prepared", DTX_PROTOCOL_COMMAND_RECOVERY_COMMIT_PREPARED},
{"recovery_abort_prepared", DTX_PROTOCOL_COMMAND_RECOVERY_ABORT_PREPARED},
{"subtransaction_begin", DTX_PROTOCOL_COMMAND_SUBTRANSACTION_BEGIN_INTERNAL},
{"subtransaction_release", DTX_PROTOCOL_COMMAND_SUBTRANSACTION_RELEASE_INTERNAL},
{"subtransaction_rollback", DTX_PROTOCOL_COMMAND_SUBTRANSACTION_ROLLBACK_INTERNAL},
{NULL, 0}
};
static const struct config_enum_entry optimizer_log_failure_options[] = {
{"all", OPTIMIZER_ALL_FAIL},
{"unexpected", OPTIMIZER_UNEXPECTED_FAIL},
{"expected", OPTIMIZER_EXPECTED_FAIL},
{NULL, 0}
};
static const struct config_enum_entry optimizer_minidump_options[] = {
{"onerror", OPTIMIZER_MINIDUMP_FAIL},
{"always", OPTIMIZER_MINIDUMP_ALWAYS},
{NULL, 0}
};
static const struct config_enum_entry optimizer_cost_model_options[] = {
{"legacy", OPTIMIZER_GPDB_LEGACY},
{"calibrated", OPTIMIZER_GPDB_CALIBRATED},
{"experimental", OPTIMIZER_GPDB_EXPERIMENTAL},
{NULL, 0}
};
static const struct config_enum_entry explain_memory_verbosity_options[] = {
{"suppress", EXPLAIN_MEMORY_VERBOSITY_SUPPRESS},
{"summary", EXPLAIN_MEMORY_VERBOSITY_SUMMARY},
{"detail", EXPLAIN_MEMORY_VERBOSITY_DETAIL},
{NULL, 0}
};
static const struct config_enum_entry debug_dtm_action_options[] = {
{"none", DEBUG_DTM_ACTION_NONE},
{"delay", DEBUG_DTM_ACTION_DELAY},
{"fail_begin_command", DEBUG_DTM_ACTION_FAIL_BEGIN_COMMAND},
{"fail_end_command", DEBUG_DTM_ACTION_FAIL_END_COMMAND},
{"panic_begin_command", DEBUG_DTM_ACTION_PANIC_BEGIN_COMMAND},
{NULL, 0}
};
static const struct config_enum_entry debug_dtm_action_target_options[] = {
{"none", DEBUG_DTM_ACTION_TARGET_NONE},
{"protocol", DEBUG_DTM_ACTION_TARGET_PROTOCOL},
{"sql", DEBUG_DTM_ACTION_TARGET_SQL},
{NULL, 0}
};
static const struct config_enum_entry gp_autostats_modes[] = {
{"none", GP_AUTOSTATS_NONE},
{"on_change", GP_AUTOSTATS_ON_CHANGE},
{"onchange", GP_AUTOSTATS_ON_CHANGE},
{"on_no_stats", GP_AUTOSTATS_ON_NO_STATS},
{NULL, 0}
};
static const struct config_enum_entry gp_interconnect_fc_methods[] = {
{"loss", INTERCONNECT_FC_METHOD_LOSS},
{"capacity", INTERCONNECT_FC_METHOD_CAPACITY},
{"loss_advance", INTERCONNECT_FC_METHOD_LOSS_ADVANCE},
{"loss_timer", INTERCONNECT_FC_METHOD_LOSS_TIMER},
{NULL, 0}
};
static const struct config_enum_entry gp_interconnect_address_types[] = {
{"wildcard", INTERCONNECT_ADDRESS_TYPE_WILDCARD},
{"unicast", INTERCONNECT_ADDRESS_TYPE_UNICAST},
{NULL, 0}
};
static const struct config_enum_entry gp_log_verbosity[] = {
{"terse", GPVARS_VERBOSITY_TERSE},
{"off", GPVARS_VERBOSITY_OFF},
{"verbose", GPVARS_VERBOSITY_VERBOSE},
{"debug", GPVARS_VERBOSITY_DEBUG},
{NULL, 0}
};
static const struct config_enum_entry gp_resqueue_memory_policies[] = {
{"none", RESMANAGER_MEMORY_POLICY_NONE},
{"auto", RESMANAGER_MEMORY_POLICY_AUTO},
{"eager_free", RESMANAGER_MEMORY_POLICY_EAGER_FREE},
{NULL, 0}
};
static const struct config_enum_entry optimizer_join_order_options[] = {
{"query", JOIN_ORDER_IN_QUERY},
{"greedy", JOIN_ORDER_GREEDY_SEARCH},
{"exhaustive", JOIN_ORDER_EXHAUSTIVE_SEARCH},
{"exhaustive2", JOIN_ORDER_EXHAUSTIVE2_SEARCH},
{NULL, 0}
};
IndexCheckType gp_indexcheck_insert = INDEX_CHECK_NONE;
struct config_bool ConfigureNamesBool_gp[] =
{
{
{"maintenance_mode", PGC_POSTMASTER, CUSTOM_OPTIONS,
gettext_noop("Maintenance Mode"),
NULL,
GUC_SUPERUSER_ONLY | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_maintenance_mode,
false,
NULL, NULL, NULL
},
{
{"gp_autostats_lock_wait", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("autostats generated ANALYZE statements to wait for lock acquisition."),
NULL
},
&gp_autostats_lock_wait,
false,
NULL, NULL, NULL
},
{
{"gp_maintenance_conn", PGC_BACKEND, CUSTOM_OPTIONS,
gettext_noop("Maintenance Connection"),
NULL,
GUC_SUPERUSER_ONLY | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_maintenance_conn,
false,
NULL, NULL, NULL
},
{
{"gp_use_legacy_hashops", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
gettext_noop("If set, new tables will use legacy distribution hashops by default"),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_use_legacy_hashops,
false,
NULL, NULL, NULL
},
{
{"allow_segment_DML", PGC_USERSET, CUSTOM_OPTIONS,
gettext_noop("Allow DML on segments"),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&allow_segment_DML,
false,
NULL, NULL, NULL
},
{
{"gp_enable_statement_trigger", PGC_USERSET, CUSTOM_OPTIONS,
gettext_noop("Enables statement triggers to be created instead of erroring out."),
NULL,
GUC_NOT_IN_SAMPLE
},
&gp_enable_statement_trigger,
false,
NULL, NULL, NULL
},
{
{"enable_groupagg", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enables the planner's use of grouping aggregation plans."),
NULL
},
&enable_groupagg,
true,
NULL, NULL, NULL
},
{
{"gp_enable_hashjoin_size_heuristic", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("In hash join plans, the smaller of the two inputs "
"(as estimated) is used to build the hash table."),
gettext_noop("If false, either input could be used to build the "
"hash table; the choice depends on the estimated hash "
"join cost, which the planner computes for both "
"alternatives. Has no effect on outer or adaptive "
"joins."),
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_enable_hashjoin_size_heuristic,
false,
NULL, NULL, NULL
},
{
{"gp_enable_direct_dispatch", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enable dispatch for single-row-insert targeted mirror-pairs."),
gettext_noop("Don't involve the whole cluster if it isn't needed.")
},
&gp_enable_direct_dispatch,
true,
NULL, NULL, NULL
},
{
{"gp_enable_predicate_propagation", PGC_USERSET, QUERY_TUNING_OTHER,
gettext_noop("When two expressions are equivalent (such as with "
"equijoined keys) then the planner applies predicates "
"on one expression to the other expression."),
gettext_noop("If false, planner does not copy predicates.")
},
&gp_enable_predicate_propagation,
true,
NULL, NULL, NULL
},
{
{"gp_enable_predicate_pushdown", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Enable predicate pushdown, some quals will be pushed down to lower data source for AO."),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_enable_predicate_pushdown,
true, NULL, NULL
},
{
{"debug_print_prelim_plan", PGC_USERSET, LOGGING_WHAT,
gettext_noop("Prints the preliminary execution plan to server log."),
NULL
},
&Debug_print_prelim_plan,
false,
NULL, NULL, NULL
},
{
{"debug_print_slice_table", PGC_USERSET, LOGGING_WHAT,
gettext_noop("Prints the slice table to server log."),
NULL
},
&Debug_print_slice_table,
false,
NULL, NULL, NULL
},
{
{"log_dispatch_stats", PGC_SUSET, STATS_MONITORING,
gettext_noop("Writes dispatcher performance statistics to the server log."),
NULL
},
&log_dispatch_stats,
false,
check_dispatch_log_stats, NULL, NULL
},
{
{"gp_enable_minmax_optimization", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enables the planner's use of index scans with limit to implement MIN/MAX."),
NULL,
GUC_NOT_IN_SAMPLE
},
&gp_enable_minmax_optimization,
true, NULL, NULL
},
{
{"gp_enable_multiphase_agg", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enables the planner's use of two- or three-stage parallel aggregation plans."),
gettext_noop("Allows partial aggregation before motion.")
},
&gp_enable_multiphase_agg,
true,
NULL, NULL, NULL
},
{
{"gp_enable_multiphase_limit", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enables the planner's use of two phase limit plans."),
gettext_noop("Allows partial limit on QEs.")
},
&gp_enable_multiphase_limit,
true,
NULL, NULL, NULL
},
{
{"gp_enable_preunique", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enable 2-phase duplicate removal."),
gettext_noop("If true, planner may choose to remove duplicates in "
"two phases--before and after redistribution.")
},
&gp_enable_preunique,
true,
NULL, NULL, NULL
},
{
{"gp_enable_agg_distinct", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enable 2-phase aggregation to compute a single distinct-qualified aggregate."),
NULL,
},
&gp_enable_agg_distinct,
true,
NULL, NULL, NULL
},
{
{"gp_enable_agg_distinct_pruning", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enable 3-phase aggregation and join to compute distinct-qualified aggregates."),
NULL,
},
&gp_enable_dqa_pruning,
true,
NULL, NULL, NULL
},
{
{"gp_enable_agg_pushdown", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enables aggregate push-down."),
NULL,
},
&gp_enable_agg_pushdown,
false,
NULL, NULL, NULL
},
{
{"gp_enable_ao_indexscan", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enable index scan for Append-Optimized tables."),
NULL,
},
&gp_enable_ao_indexscan,
false,
NULL, NULL, NULL
},
{
{"gp_enable_explain_allstat", PGC_USERSET, CLIENT_CONN_OTHER,
gettext_noop("Experimental feature: dump stats for all segments in EXPLAIN ANALYZE."),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_enable_explain_allstat,
false,
NULL, NULL, NULL
},
{
{"gp_enable_sort_limit", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enable LIMIT operation to be performed while sorting."),
gettext_noop("Sort more efficiently when plan requires the first <n> rows at most.")
},
&gp_enable_sort_limit,
true,
NULL, NULL, NULL
},
{
{"gp_enable_motion_deadlock_sanity", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Enable verbose check at planning time."),
NULL,
GUC_NO_RESET_ALL | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_enable_motion_deadlock_sanity,
false,
NULL, NULL, NULL
},
{
{"gp_adjust_selectivity_for_outerjoins", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Adjust selectivity of null tests over outer joins."),
NULL,
GUC_NOT_IN_SAMPLE
},
&gp_adjust_selectivity_for_outerjoins,
true,
NULL, NULL, NULL
},
{
{"gp_selectivity_damping_for_scans", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Damping of selectivities for clauses over the same base relation."),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_selectivity_damping_for_scans,
true,
NULL, NULL, NULL
},
{
{"gp_selectivity_damping_for_joins", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Damping of selectivities in join clauses."),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_selectivity_damping_for_joins,
false,
NULL, NULL, NULL
},
{
{"gp_selectivity_damping_sigsort", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Sort selectivities by ascending significance, i.e. smallest first"),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_selectivity_damping_sigsort,
true,
NULL, NULL, NULL
},
{
{"gp_enable_interconnect_aggressive_retry", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Enable application-level fast-track interconnect retries"),
NULL,
GUC_NO_RESET_ALL | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_interconnect_aggressive_retry,
true,
NULL, NULL, NULL
},
{
{"gp_select_invisible", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Use dummy snapshot for MVCC visibility calculation."),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_select_invisible,
false,
NULL, NULL, NULL
},
{
{"gp_enable_slow_writer_testmode", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Slow down writer gangs -- to facilitate race-condition testing."),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_enable_slow_writer_testmode,
false,
NULL, NULL, NULL
},
{
{"gp_debug_pgproc", PGC_POSTMASTER, DEVELOPER_OPTIONS,
gettext_noop("Print debug info relevant to PGPROC."),
NULL /* long description */ ,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&gp_debug_pgproc,
false,
NULL, NULL, NULL
},
{
{"gp_appendonly_verify_block_checksums", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Verify the append-only block checksum when reading."),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_appendonly_verify_block_checksums,
true,
NULL, NULL, NULL
},
{
{"gp_appendonly_verify_write_block", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Verify the append-only block as it is being written."),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_appendonly_verify_write_block,
false,
NULL, NULL, NULL
},
{
{"gp_appendonly_compaction", PGC_SUSET, APPENDONLY_TABLES,
gettext_noop("Perform append-only compaction instead of eof truncation on vacuum."),
NULL,
GUC_SUPERUSER_ONLY | GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_appendonly_compaction,
true,
NULL, NULL, NULL
},
{
{"gp_heap_require_relhasoids_match", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Issue an error on discovery of a mismatch between relhasoids and a tuple header."),
NULL,
GUC_NOT_IN_SAMPLE | GUC_NO_SHOW_ALL
},
&gp_heap_require_relhasoids_match,
true,
NULL, NULL, NULL
},
{
{"debug_burn_xids", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Consume a lot of XIDs, for testing purposes."),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&Debug_burn_xids,
false,