-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathguc.h
More file actions
191 lines (166 loc) · 6.88 KB
/
Copy pathguc.h
File metadata and controls
191 lines (166 loc) · 6.88 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
/*
* This file and its contents are licensed under the Apache License 2.0.
* Please see the included NOTICE for copyright information and
* LICENSE-APACHE for a copy of the license.
*/
#pragma once
#include <postgres.h>
#include "compat/compat.h"
#include "config.h"
#include "export.h"
#ifdef USE_TELEMETRY
extern bool ts_telemetry_on(void);
extern bool ts_function_telemetry_on(void);
#endif
extern bool ts_guc_enable_deprecation_warnings;
extern TSDLLEXPORT bool ts_guc_enable_optimizations;
extern bool ts_guc_enable_constraint_aware_append;
extern bool ts_guc_enable_ordered_append;
extern bool ts_guc_enable_chunk_append;
extern bool ts_guc_enable_parallel_chunk_append;
extern bool ts_guc_enable_qual_propagation;
extern TSDLLEXPORT bool ts_guc_enable_columnar_scan_filter_pushdown;
extern bool ts_guc_enable_qual_filtering;
extern bool ts_guc_enable_runtime_exclusion;
extern bool ts_guc_enable_constraint_exclusion;
extern bool ts_guc_enable_cagg_reorder_groupby;
extern TSDLLEXPORT bool ts_guc_enable_cagg_window_functions;
extern TSDLLEXPORT bool ts_guc_skip_cagg_invalidation;
extern TSDLLEXPORT int ts_guc_cagg_max_individual_materializations;
extern bool ts_guc_enable_now_constify;
extern bool ts_guc_enable_foreign_key_propagation;
extern TSDLLEXPORT bool ts_guc_enable_osm_reads;
#if PG16_GE
extern TSDLLEXPORT bool ts_guc_enable_cagg_sort_pushdown;
#endif
extern TSDLLEXPORT bool ts_guc_enable_cagg_watermark_constify;
extern TSDLLEXPORT bool ts_guc_enable_compressed_merge;
extern TSDLLEXPORT bool ts_guc_enable_dml_decompression;
extern TSDLLEXPORT bool ts_guc_enable_dml_decompression_tuple_filtering;
extern TSDLLEXPORT bool ts_guc_enable_dml_bloom_filter;
extern bool ts_guc_enable_direct_compress_copy;
extern bool ts_guc_enable_direct_compress_copy_sort_batches;
extern bool ts_guc_enable_direct_compress_copy_client_sorted;
extern int ts_guc_direct_compress_copy_tuple_sort_limit;
extern TSDLLEXPORT bool ts_guc_enable_direct_compress_insert;
extern bool ts_guc_enable_direct_compress_insert_sort_batches;
extern TSDLLEXPORT bool ts_guc_enable_direct_compress_insert_client_sorted;
extern TSDLLEXPORT bool ts_guc_enable_direct_compress_on_cagg_refresh;
extern TSDLLEXPORT bool ts_guc_enable_direct_compress_auto_segmentby;
extern int ts_guc_direct_compress_insert_tuple_sort_limit;
extern TSDLLEXPORT int ts_guc_direct_compress_segmentby_min_rows;
extern TSDLLEXPORT int ts_guc_direct_compress_segmentby_batch_size_limit;
extern TSDLLEXPORT bool ts_guc_enable_compressed_direct_batch_delete;
extern TSDLLEXPORT int ts_guc_max_tuples_decompressed_per_dml;
extern TSDLLEXPORT bool ts_guc_enable_compression_wal_markers;
extern TSDLLEXPORT bool ts_guc_enable_decompression_sorted_merge;
extern TSDLLEXPORT bool ts_guc_enable_skip_scan;
extern TSDLLEXPORT bool ts_guc_enable_chunkwise_aggregation;
extern TSDLLEXPORT bool ts_guc_enable_vectorized_aggregation;
extern bool ts_guc_restoring;
extern int ts_guc_max_open_chunks_per_insert;
extern int ts_guc_max_cached_chunks_per_hypertable;
extern TSDLLEXPORT bool ts_guc_enable_job_execution_logging;
extern bool ts_guc_enable_tss_callbacks;
extern TSDLLEXPORT bool ts_guc_enable_delete_after_compression;
extern TSDLLEXPORT bool ts_guc_enable_merge_on_cagg_refresh;
extern bool ts_guc_enable_chunk_skipping;
extern TSDLLEXPORT bool ts_guc_enable_segmentwise_recompression;
extern TSDLLEXPORT bool ts_guc_enable_in_memory_recompression;
extern TSDLLEXPORT bool ts_guc_enable_exclusive_locking_recompression;
extern TSDLLEXPORT bool ts_guc_enable_bool_compression;
extern TSDLLEXPORT bool ts_guc_enable_uuid_compression;
extern TSDLLEXPORT int ts_guc_compression_batch_size_limit;
extern TSDLLEXPORT bool ts_guc_compression_enable_compressor_batch_limit;
#if PG16_GE
extern TSDLLEXPORT bool ts_guc_enable_skip_scan_for_distinct_aggregates;
#endif
extern bool ts_guc_enable_event_triggers;
extern bool ts_guc_enable_chunk_auto_publication;
extern TSDLLEXPORT bool ts_guc_enable_compressed_skip_scan;
extern TSDLLEXPORT bool ts_guc_enable_multikey_skip_scan;
extern TSDLLEXPORT double ts_guc_skip_scan_run_cost_multiplier;
extern TSDLLEXPORT bool ts_guc_debug_skip_scan_info;
#if PG16_GE
extern TSDLLEXPORT bool ts_guc_enable_cagg_rewrites;
extern TSDLLEXPORT bool ts_guc_cagg_rewrites_debug_info;
#endif
/* Only settable in debug mode for testing */
extern TSDLLEXPORT bool ts_guc_enable_null_compression;
extern TSDLLEXPORT bool ts_guc_enable_compression_ratio_warnings;
typedef enum CompressTruncateBehaviour
{
COMPRESS_TRUNCATE_ONLY,
COMPRESS_TRUNCATE_OR_DELETE,
COMPRESS_TRUNCATE_DISABLED,
} CompressTruncateBehaviour;
extern TSDLLEXPORT CompressTruncateBehaviour ts_guc_compress_truncate_behaviour;
#ifdef USE_TELEMETRY
typedef enum TelemetryLevel
{
TELEMETRY_OFF,
TELEMETRY_NO_FUNCTIONS,
TELEMETRY_BASIC,
} TelemetryLevel;
extern TelemetryLevel ts_guc_telemetry_level;
extern char *ts_telemetry_cloud;
#endif
extern TSDLLEXPORT char *ts_guc_license;
extern TSDLLEXPORT bool ts_guc_enable_compression_indexscan;
extern TSDLLEXPORT bool ts_guc_enable_bulk_decompression;
extern TSDLLEXPORT bool ts_guc_auto_sparse_indexes;
extern TSDLLEXPORT bool ts_guc_enable_sparse_index_bloom;
extern TSDLLEXPORT bool ts_guc_enable_composite_bloom_indexes;
extern TSDLLEXPORT bool ts_guc_read_legacy_bloom1_v1;
extern TSDLLEXPORT bool ts_guc_enable_columnarscan;
extern TSDLLEXPORT bool ts_guc_enable_columnarindexscan;
extern TSDLLEXPORT int ts_guc_bgw_log_level;
/*
* Exit code to use when scheduler exits.
*
* Used for debugging.
*/
extern TSDLLEXPORT int ts_debug_bgw_scheduler_exit_status;
#ifdef TS_DEBUG
extern bool ts_shutdown_bgw;
extern char *ts_current_timestamp_mock;
#else
#define ts_shutdown_bgw false
#endif
extern TSDLLEXPORT int ts_guc_debug_toast_tuple_target;
typedef enum DebugRequireOption
{
DRO_Allow = 0,
DRO_Forbid,
DRO_Require,
DRO_Force,
} DebugRequireOption;
#ifdef TS_DEBUG
extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_vector_qual;
extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_vector_agg;
#endif
extern TSDLLEXPORT bool ts_guc_debug_compression_path_info;
extern TSDLLEXPORT bool ts_guc_enable_rowlevel_compression_locking;
extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_batch_sorted_merge;
extern bool ts_guc_enable_partitioned_hypertables;
extern TSDLLEXPORT int ts_guc_stats_max_chunks;
#define TS_STATS_MAX_CHUNKS_DEFAULT 1024
#define TS_STATS_MAX_CHUNKS_MIN 256
#define TS_STATS_MAX_CHUNKS_MAX 262144
#define IS_STATS_CHUNKS_ENABLED() (ts_guc_stats_max_chunks > 0)
void _guc_init(void);
typedef enum
{
FEATURE_HYPERTABLE,
FEATURE_HYPERTABLE_COMPRESSION,
FEATURE_CAGG,
FEATURE_POLICY
} FeatureFlagType;
extern TSDLLEXPORT void ts_feature_flag_check(FeatureFlagType);
extern TSDLLEXPORT Oid ts_guc_default_segmentby_fn_oid(void);
extern TSDLLEXPORT Oid ts_guc_default_orderby_fn_oid(void);
#define TARGET_COMPRESSED_BATCH_SIZE 1000
/*
* We use this limit for sanity checks in case the compressed data is corrupt.
*/
#define GLOBAL_MAX_ROWS_PER_COMPRESSION INT16_MAX