Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@ -115,6 +115,7 @@ enum ModuleId {
|
||||
MOD_WALRECEIVER, /* walreceiver */
|
||||
MOD_USTORE, /* ustore */
|
||||
MOD_UNDO, /* undo */
|
||||
MOD_TIMECAPSULE, /* timecapsule */
|
||||
MOD_GEN_COL, /* generated column */
|
||||
MOD_DCF, /* DCF paxos */
|
||||
MOD_DB4AI, /* DB4AI & AUTOML */
|
||||
@ -135,8 +136,13 @@ enum ModuleId {
|
||||
MOD_SPI,
|
||||
MOD_NEST_COMPILE,
|
||||
MOD_RESOWNER,
|
||||
MOD_GSSTACK,
|
||||
MOD_LOGICAL_DECODE, /* logical decode */
|
||||
MOD_GPRC, /* global package runtime cache */
|
||||
MOD_DISASTER_READ,
|
||||
|
||||
MODE_REPSYNC, /* debug info for func SyncRepWaitForLSN */
|
||||
MOD_SQLPATCH,
|
||||
|
||||
/*
|
||||
* Add your module id above.
|
||||
|
||||
@ -25,6 +25,34 @@
|
||||
#endif
|
||||
#include "utils/sortsupport.h"
|
||||
|
||||
/*
|
||||
* Array giving the position of the left-most set bit for each possible
|
||||
* byte value. We count the right-most position as the 0th bit, and the
|
||||
* left-most the 7th bit. The 0th entry of the array should not be used.
|
||||
*
|
||||
* Note: this is not used by the functions in pg_bitutils.h when
|
||||
* HAVE__BUILTIN_CLZ is defined, but we provide it anyway, so that
|
||||
* extensions possibly compiled with a different compiler can use it.
|
||||
*/
|
||||
const uint8 pg_leftmost_one_pos[256] = {
|
||||
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
||||
};
|
||||
|
||||
/*
|
||||
* Defined in adt/
|
||||
*/
|
||||
@ -186,6 +214,10 @@ extern Datum binary_decode(PG_FUNCTION_ARGS);
|
||||
extern unsigned hex_encode(const char* src, unsigned len, char* dst);
|
||||
extern unsigned hex_decode(const char* src, unsigned len, char* dst);
|
||||
|
||||
/* encrypt_decrypt.c */
|
||||
extern Datum aes_encrypt(PG_FUNCTION_ARGS);
|
||||
extern Datum aes_decrypt(PG_FUNCTION_ARGS);
|
||||
|
||||
/* enum.c */
|
||||
extern Datum enum_in(PG_FUNCTION_ARGS);
|
||||
extern Datum enum_out(PG_FUNCTION_ARGS);
|
||||
@ -205,6 +237,77 @@ extern Datum enum_last(PG_FUNCTION_ARGS);
|
||||
extern Datum enum_range_bounds(PG_FUNCTION_ARGS);
|
||||
extern Datum enum_range_all(PG_FUNCTION_ARGS);
|
||||
|
||||
/* set.c */
|
||||
extern Datum set_in(PG_FUNCTION_ARGS);
|
||||
extern Datum set_out(PG_FUNCTION_ARGS);
|
||||
extern Datum set_recv(PG_FUNCTION_ARGS);
|
||||
extern Datum set_send(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8(PG_FUNCTION_ARGS);
|
||||
extern Datum settof(PG_FUNCTION_ARGS);
|
||||
extern Datum settod(PG_FUNCTION_ARGS);
|
||||
extern Datum settonumber(PG_FUNCTION_ARGS);
|
||||
extern Datum settobpchar(PG_FUNCTION_ARGS);
|
||||
extern Datum settovarchar(PG_FUNCTION_ARGS);
|
||||
extern Datum settotext(PG_FUNCTION_ARGS);
|
||||
extern Datum settonvarchar2(PG_FUNCTION_ARGS);
|
||||
extern Datum i8toset(PG_FUNCTION_ARGS);
|
||||
extern Datum i4toset(PG_FUNCTION_ARGS);
|
||||
extern Datum i2toset(PG_FUNCTION_ARGS);
|
||||
extern Datum ftoset(PG_FUNCTION_ARGS);
|
||||
extern Datum dtoset(PG_FUNCTION_ARGS);
|
||||
extern Datum numbertoset(PG_FUNCTION_ARGS);
|
||||
extern Datum bpchartoset(PG_FUNCTION_ARGS);
|
||||
extern Datum varchartoset(PG_FUNCTION_ARGS);
|
||||
extern Datum texttoset(PG_FUNCTION_ARGS);
|
||||
extern Datum nvarchar2toset(PG_FUNCTION_ARGS);
|
||||
extern Datum btsetcmp(PG_FUNCTION_ARGS);
|
||||
extern Datum seteq(PG_FUNCTION_ARGS);
|
||||
extern Datum setne(PG_FUNCTION_ARGS);
|
||||
extern Datum setlt(PG_FUNCTION_ARGS);
|
||||
extern Datum setgt(PG_FUNCTION_ARGS);
|
||||
extern Datum setle(PG_FUNCTION_ARGS);
|
||||
extern Datum setge(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8eq(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8ne(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8lt(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8gt(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8le(PG_FUNCTION_ARGS);
|
||||
extern Datum setint8ge(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2eq(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2ne(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2lt(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2gt(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2le(PG_FUNCTION_ARGS);
|
||||
extern Datum setint2ge(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4eq(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4ne(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4lt(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4gt(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4le(PG_FUNCTION_ARGS);
|
||||
extern Datum setint4ge(PG_FUNCTION_ARGS);
|
||||
extern Datum int8seteq(PG_FUNCTION_ARGS);
|
||||
extern Datum int8setne(PG_FUNCTION_ARGS);
|
||||
extern Datum int8setlt(PG_FUNCTION_ARGS);
|
||||
extern Datum int8setgt(PG_FUNCTION_ARGS);
|
||||
extern Datum int8setle(PG_FUNCTION_ARGS);
|
||||
extern Datum int8setge(PG_FUNCTION_ARGS);
|
||||
extern Datum int2seteq(PG_FUNCTION_ARGS);
|
||||
extern Datum int2setne(PG_FUNCTION_ARGS);
|
||||
extern Datum int2setlt(PG_FUNCTION_ARGS);
|
||||
extern Datum int2setgt(PG_FUNCTION_ARGS);
|
||||
extern Datum int2setle(PG_FUNCTION_ARGS);
|
||||
extern Datum int2setge(PG_FUNCTION_ARGS);
|
||||
extern Datum int4seteq(PG_FUNCTION_ARGS);
|
||||
extern Datum int4setne(PG_FUNCTION_ARGS);
|
||||
extern Datum int4setlt(PG_FUNCTION_ARGS);
|
||||
extern Datum int4setgt(PG_FUNCTION_ARGS);
|
||||
extern Datum int4setle(PG_FUNCTION_ARGS);
|
||||
extern Datum int4setge(PG_FUNCTION_ARGS);
|
||||
extern Datum findinset(PG_FUNCTION_ARGS);
|
||||
extern Datum btint8sortsupport(PG_FUNCTION_ARGS);
|
||||
|
||||
/* int.c */
|
||||
extern Datum int2in(PG_FUNCTION_ARGS);
|
||||
extern Datum int2out(PG_FUNCTION_ARGS);
|
||||
@ -665,6 +768,9 @@ extern Datum void_in(PG_FUNCTION_ARGS);
|
||||
extern Datum void_out(PG_FUNCTION_ARGS);
|
||||
extern Datum void_recv(PG_FUNCTION_ARGS);
|
||||
extern Datum void_send(PG_FUNCTION_ARGS);
|
||||
extern Datum anyset_in(PG_FUNCTION_ARGS);
|
||||
extern Datum anyset_out(PG_FUNCTION_ARGS);
|
||||
|
||||
#ifdef PGXC
|
||||
extern Datum pgxc_node_str(PG_FUNCTION_ARGS);
|
||||
extern Datum pgxc_lock_for_backup(PG_FUNCTION_ARGS);
|
||||
@ -912,6 +1018,7 @@ extern Datum instr_3args(PG_FUNCTION_ARGS);
|
||||
extern Datum instr_4args(PG_FUNCTION_ARGS);
|
||||
extern Datum byteain(PG_FUNCTION_ARGS);
|
||||
extern void text_to_bktmap(text* gbucket, uint2* bktmap, int *bktlen);
|
||||
extern bytea* bytea_substring(Datum str, int S, int L, bool length_not_specified);
|
||||
|
||||
#define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s))
|
||||
#define TextDatumGetCString(d) text_to_cstring((text*)DatumGetPointer(d))
|
||||
@ -982,6 +1089,9 @@ extern Datum to_hex32(PG_FUNCTION_ARGS);
|
||||
extern Datum to_hex64(PG_FUNCTION_ARGS);
|
||||
extern Datum md5_text(PG_FUNCTION_ARGS);
|
||||
extern Datum md5_bytea(PG_FUNCTION_ARGS);
|
||||
extern Datum sha(PG_FUNCTION_ARGS);
|
||||
extern Datum sha1(PG_FUNCTION_ARGS);
|
||||
extern Datum sha2(PG_FUNCTION_ARGS);
|
||||
|
||||
extern Datum unknownin(PG_FUNCTION_ARGS);
|
||||
extern Datum unknownout(PG_FUNCTION_ARGS);
|
||||
@ -997,6 +1107,9 @@ extern Datum string_agg_transfn(PG_FUNCTION_ARGS);
|
||||
extern Datum string_agg_finalfn(PG_FUNCTION_ARGS);
|
||||
extern Datum checksumtext_agg_transfn(PG_FUNCTION_ARGS);
|
||||
|
||||
extern Datum group_concat_transfn(PG_FUNCTION_ARGS);
|
||||
extern Datum group_concat_finalfn(PG_FUNCTION_ARGS);
|
||||
|
||||
extern Datum list_agg_transfn(PG_FUNCTION_ARGS);
|
||||
extern Datum list_agg_finalfn(PG_FUNCTION_ARGS);
|
||||
extern Datum list_agg_noarg2_transfn(PG_FUNCTION_ARGS);
|
||||
@ -1183,6 +1296,7 @@ extern Datum hashmacaddr(PG_FUNCTION_ARGS);
|
||||
/* numeric.c */
|
||||
extern Datum numeric_in(PG_FUNCTION_ARGS);
|
||||
extern Datum numeric_out(PG_FUNCTION_ARGS);
|
||||
extern Datum numeric_out_with_zero(PG_FUNCTION_ARGS);
|
||||
extern Datum numeric_recv(PG_FUNCTION_ARGS);
|
||||
extern Datum numeric_send(PG_FUNCTION_ARGS);
|
||||
extern Datum numerictypmodin(PG_FUNCTION_ARGS);
|
||||
@ -1348,6 +1462,9 @@ extern Datum pg_advisory_unlock_int4(PG_FUNCTION_ARGS);
|
||||
extern Datum pg_advisory_unlock_shared_int4(PG_FUNCTION_ARGS);
|
||||
extern Datum pg_advisory_unlock_all(PG_FUNCTION_ARGS);
|
||||
|
||||
/* pgstatfuncs.cpp */
|
||||
extern Datum gs_stack(PG_FUNCTION_ARGS);
|
||||
|
||||
/* txid.c */
|
||||
extern Datum txid_snapshot_in(PG_FUNCTION_ARGS);
|
||||
extern Datum txid_snapshot_out(PG_FUNCTION_ARGS);
|
||||
@ -1636,6 +1753,13 @@ Datum gs_index_verify(PG_FUNCTION_ARGS);
|
||||
Datum gs_index_recycle_queue(PG_FUNCTION_ARGS);
|
||||
|
||||
/* undo meta */
|
||||
extern Datum gs_undo_meta_dump_zone(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_meta_dump_spaces(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_meta_dump_slot(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_translot_dump_slot(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_translot_dump_xid(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_dump_record(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_dump_xid(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_meta(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_stat_undo(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_undo_translot(PG_FUNCTION_ARGS);
|
||||
@ -1689,6 +1813,76 @@ extern Datum pg_get_publication_tables(PG_FUNCTION_ARGS);
|
||||
/* launcher.cpp */
|
||||
extern Datum pg_stat_get_subscription(PG_FUNCTION_ARGS);
|
||||
|
||||
#endif /* !FRONTEND_PARSER */
|
||||
/* sqlpatch.cpp */
|
||||
extern Datum create_sql_patch_by_id_hint(PG_FUNCTION_ARGS);
|
||||
extern Datum enable_sql_patch(PG_FUNCTION_ARGS);
|
||||
extern Datum disable_sql_patch(PG_FUNCTION_ARGS);
|
||||
extern Datum drop_sql_patch(PG_FUNCTION_ARGS);
|
||||
extern Datum create_abort_patch_by_id(PG_FUNCTION_ARGS);
|
||||
extern Datum show_sql_patch(PG_FUNCTION_ARGS);
|
||||
|
||||
/* row-compression genfile.c */
|
||||
extern Datum compress_address_header(PG_FUNCTION_ARGS);
|
||||
extern Datum compress_address_details(PG_FUNCTION_ARGS);
|
||||
extern Datum compress_buffer_stat_info(PG_FUNCTION_ARGS);
|
||||
extern Datum compress_ratio_info(PG_FUNCTION_ARGS);
|
||||
extern Datum compress_statistic_info(PG_FUNCTION_ARGS);
|
||||
extern Datum pg_read_binary_file_blocks(PG_FUNCTION_ARGS);
|
||||
|
||||
#else
|
||||
/*
|
||||
* Array giving the position of the left-most set bit for each possible
|
||||
* byte value. We count the right-most position as the 0th bit, and the
|
||||
* left-most the 7th bit. The 0th entry of the array should not be used.
|
||||
*
|
||||
* Note: this is not used by the functions in pg_bitutils.h when
|
||||
* HAVE__BUILTIN_CLZ is defined, but we provide it anyway, so that
|
||||
* extensions possibly compiled with a different compiler can use it.
|
||||
*/
|
||||
PGDLLIMPORT const uint8 pg_leftmost_one_pos[256] = {
|
||||
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
||||
};
|
||||
#endif
|
||||
extern char *pg_ultostr(char *str, uint32 value);
|
||||
extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
|
||||
|
||||
|
||||
/*
|
||||
* pg_leftmost_one_pos32
|
||||
* Returns the position of the most significant set bit in "word",
|
||||
* measured from the least significant bit. word must not be 0.
|
||||
*/
|
||||
static inline int pg_leftmost_one_pos32(uint32 word)
|
||||
{
|
||||
#ifdef HAVE__BUILTIN_CLZ
|
||||
Assert(word != 0);
|
||||
|
||||
return 31 - __builtin_clz(word);
|
||||
#else
|
||||
int shift = 32 - 8;
|
||||
|
||||
Assert(word != 0);
|
||||
|
||||
while ((word >> shift) == 0)
|
||||
shift -= 8;
|
||||
|
||||
return shift + pg_leftmost_one_pos[(word >> shift) & 255];
|
||||
#endif /* HAVE__BUILTIN_CLZ */
|
||||
}
|
||||
|
||||
#endif /* BUILTINS_H */
|
||||
|
||||
@ -530,6 +530,7 @@ extern void FlushErrorStateWithoutDeleteChildrenContext(void);
|
||||
extern void ReThrowError(ErrorData* edata) __attribute__((noreturn));
|
||||
extern void pg_re_throw(void) __attribute__((noreturn));
|
||||
extern void PgRethrowAsFatal(void);
|
||||
extern char* pg_strdup(const char* in);
|
||||
|
||||
/* GUC-configurable parameters */
|
||||
|
||||
|
||||
@ -34,6 +34,10 @@
|
||||
#include "utils/catcache.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
#include "optimizer/func_dependency.h"
|
||||
#endif
|
||||
#include "optimizer/aioptimizer.h"
|
||||
#define ES_LOGLEVEL DEBUG3
|
||||
#define ES_COMMIT_VERSION 91112
|
||||
|
||||
@ -49,7 +53,9 @@ typedef enum ES_STATISTIC_KIND {
|
||||
ES_DNDISTINCT = 0x08u,
|
||||
ES_MCV = 0x10u,
|
||||
ES_NULL_MCV = 0x20u,
|
||||
ES_ALL = 0x3fu
|
||||
ES_DEPENDENCY = 0x40u,
|
||||
ES_AI = 0x80u,
|
||||
ES_ALL = 0xFFu
|
||||
} ES_STATISTIC_KIND;
|
||||
|
||||
typedef enum ES_COLUMN_NAME_ALIAS { ES_COLUMN_NAME = 0x01u, ES_COLUMN_ALIAS = 0x02u } ES_COLUMN_NAME_ALIAS;
|
||||
@ -67,6 +73,11 @@ typedef struct ExtendedStats {
|
||||
int mcv_nnumbers;
|
||||
float4* other_mcv_numbers = NULL;
|
||||
int other_mcv_nnumbers;
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
MVDependencies* dependencies = NULL;
|
||||
#endif
|
||||
char* bayesnet_model = NULL;
|
||||
} ExtendedStats;
|
||||
|
||||
extern void es_free_extendedstats(ExtendedStats* es);
|
||||
@ -105,6 +116,8 @@ extern bool es_is_distributekey_contained_in_multi_column(Oid relid, VacAttrStat
|
||||
*/
|
||||
extern char* es_get_column_name_alias(AnalyzeSampleTableSpecInfo* spec, uint32 name_alias_flag,
|
||||
const char* separator = ", ", const char* prefix = "", const char* postfix = "");
|
||||
extern char* get_column_name_alias(AnalyzeSampleTableSpecInfo* spec, uint32 name_alias_flag,
|
||||
const uint32 *indexes, int num_index);
|
||||
|
||||
/*
|
||||
* System table
|
||||
@ -118,6 +131,10 @@ extern VacAttrStats** es_build_vacattrstats_array(
|
||||
extern ArrayType* es_construct_mcv_value_array(VacAttrStats* stats, int mcv_slot_index);
|
||||
extern bool es_is_multicolumn_stats_exists(Oid relid, char relkind, bool inh, Bitmapset* bms_attnums);
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
extern ArrayType* es_construct_dependency_value_array(const VacAttrStats* stats, int dependency_slot_index);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interfaces for optimizer
|
||||
*/
|
||||
|
||||
@ -103,6 +103,7 @@ typedef struct GPCPlainEnv
|
||||
int qrw_inlist2join_optmode;// QUERY_TUNING_OTHER2
|
||||
int skew_strategy_store;// QUERY_TUNING_OTHER2
|
||||
unsigned int behavior_compat_flags;
|
||||
unsigned int plsql_compile_behavior_compat_flags;
|
||||
int datestyle;
|
||||
int dateorder;
|
||||
int plancachemode; // QUERY_TUNING_OTHER
|
||||
@ -210,7 +211,6 @@ extern Datum GPCPlanClean(PG_FUNCTION_ARGS);
|
||||
extern void GPCResetAll();
|
||||
void GPCCleanDatanodeStatement(int dn_stmt_num, const char* stmt_name);
|
||||
void GPCReGplan(CachedPlanSource* plansource);
|
||||
void CNGPCCleanUpSession();
|
||||
void GPCCleanUpSessionSavedPlan();
|
||||
List* CopyLocalStmt(const List* stmt_list, const MemoryContext parent_cxt, MemoryContext* plan_context);
|
||||
bool SPIParseEnableGPC(const Node *node);
|
||||
|
||||
@ -106,6 +106,24 @@ typedef enum {
|
||||
PGC_S_SESSION /* SET command */
|
||||
} GucSource;
|
||||
|
||||
typedef enum {
|
||||
AES_128_CBC,
|
||||
AES_192_CBC,
|
||||
AES_256_CBC,
|
||||
AES_128_CFB1,
|
||||
AES_192_CFB1,
|
||||
AES_256_CFB1,
|
||||
AES_128_CFB8,
|
||||
AES_192_CFB8,
|
||||
AES_256_CFB8,
|
||||
AES_128_CFB128,
|
||||
AES_192_CFB128,
|
||||
AES_256_CFB128,
|
||||
AES_128_OFB,
|
||||
AES_192_OFB,
|
||||
AES_256_OFB
|
||||
} AesBlockMode;
|
||||
|
||||
/*
|
||||
* Parsing the configuration file will return a list of name-value pairs
|
||||
* with source location info.
|
||||
@ -170,6 +188,11 @@ typedef struct {
|
||||
char* query; /* set query string */
|
||||
} GucParamsEntry;
|
||||
|
||||
typedef struct {
|
||||
char name[NAMEDATALEN]; /* user-defined name */
|
||||
Const *value;
|
||||
} GucUserParamsEntry;
|
||||
|
||||
#define GUC_QUALIFIER_SEPARATOR '.'
|
||||
|
||||
/*
|
||||
@ -274,7 +297,7 @@ extern TupleDesc GetPGVariableResultDesc(const char* name);
|
||||
extern char* RewriteBeginQuery(char* query_string, const char* name, List* args);
|
||||
#endif
|
||||
|
||||
extern void ExecSetVariableStmt(VariableSetStmt* stmt);
|
||||
extern void ExecSetVariableStmt(VariableSetStmt* stmt, ParamListInfo paramInfo);
|
||||
extern char* ExtractSetVariableArgs(VariableSetStmt* stmt);
|
||||
|
||||
extern void ProcessGUCArray(ArrayType* array, GucContext context, GucSource source, GucAction action);
|
||||
@ -331,6 +354,9 @@ extern void assign_xlog_sync_method(int new_sync_method, void* extra);
|
||||
/* in tcop/stmt_retry.cpp */
|
||||
extern bool check_errcode_list(char** newval, void** extra, GucSource source);
|
||||
|
||||
/* in nvm.cpp */
|
||||
extern bool check_nvm_path(char** newval, void** extra, GucSource source);
|
||||
|
||||
/*
|
||||
* Error code for config file
|
||||
*/
|
||||
@ -357,6 +383,7 @@ typedef enum {
|
||||
PRED_PUSH = 64, /* push predicate into subquery block */
|
||||
PRED_PUSH_NORMAL = 128,
|
||||
PRED_PUSH_FORCE = 256,
|
||||
SUBLINK_PULLUP_DISABLE_EXPR = 512, /* disable pull sublink in expr clause */
|
||||
} rewrite_param;
|
||||
|
||||
typedef enum {
|
||||
@ -375,7 +402,8 @@ typedef enum {
|
||||
A_STYLE_COERCE = 2048,
|
||||
PLPGSQL_STREAM_FETCHALL = 4096, /* fetch all tuple when has stream sql under plpgsql's for-loop */
|
||||
PREDPUSH_SAME_LEVEL = 8192, /* predpush same level */
|
||||
PARTITION_FDW_ON = 16384 /* support create foreign table on partitioned table */
|
||||
PARTITION_FDW_ON = 16384, /* support create foreign table on partitioned table */
|
||||
DISABLE_BITMAP_COST_WITH_LOSSY_PAGES = 32768 /* stop computing bitmap path cost with lossy pages */
|
||||
} sql_beta_param;
|
||||
|
||||
typedef enum {
|
||||
@ -389,6 +417,12 @@ typedef enum {
|
||||
SQL_OVERWRITE_NULL
|
||||
}SqlIgnoreHandleStrategy;
|
||||
|
||||
typedef enum {
|
||||
BAYESNET_OPTION,
|
||||
MCV_OPTION,
|
||||
ALL_OPTION
|
||||
} MultiStatsOptions;
|
||||
|
||||
#define ENABLE_PRED_PUSH(root) \
|
||||
((PRED_PUSH & (uint)u_sess->attr.attr_sql.rewrite_rule) && permit_predpush(root))
|
||||
|
||||
@ -398,6 +432,9 @@ typedef enum {
|
||||
#define ENABLE_PRED_PUSH_FORCE(root) \
|
||||
((PRED_PUSH_FORCE & (uint)u_sess->attr.attr_sql.rewrite_rule) && permit_predpush(root))
|
||||
|
||||
#define DISABLE_SUBLINK_PULLUP_EXPR() \
|
||||
((SUBLINK_PULLUP_DISABLE_EXPR) & (uint)u_sess->attr.attr_sql.rewrite_rule)
|
||||
|
||||
#define ENABLE_PRED_PUSH_ALL(root) \
|
||||
((ENABLE_PRED_PUSH(root) || ENABLE_PRED_PUSH_NORMAL(root) || ENABLE_PRED_PUSH_FORCE(root)) && permit_predpush(root))
|
||||
|
||||
@ -407,7 +444,8 @@ typedef enum {
|
||||
#define PARTITION_OPFUSION_MAX_NUMA_NODE 4
|
||||
#define PARTITION_ENABLE_CACHE_OPFUSION \
|
||||
(ENABLE_SQL_BETA_FEATURE(PARTITION_OPFUSION) && \
|
||||
g_instance.shmem_cxt.numaNodeNum <= PARTITION_OPFUSION_MAX_NUMA_NODE)
|
||||
g_instance.shmem_cxt.numaNodeNum <= PARTITION_OPFUSION_MAX_NUMA_NODE && \
|
||||
!g_instance.attr.attr_common.enable_global_syscache)
|
||||
|
||||
typedef enum {
|
||||
SUMMARY = 0, /* not collect multi column statistics info */
|
||||
@ -450,8 +488,10 @@ extern void reset_set_message(bool);
|
||||
extern void append_set_message(const char* str);
|
||||
|
||||
extern void init_set_params_htab(void);
|
||||
extern void init_set_user_params_htab(void);
|
||||
extern void make_set_message(void);
|
||||
extern int check_set_message_to_send(const VariableSetStmt* stmt, const char* queryString);
|
||||
extern int check_set_user_message(const UserSetElem *elem);
|
||||
|
||||
#define TRANS_ENCRYPT_SAMPLE_RNDM "1234567890ABCDEF"
|
||||
#define TRANS_ENCRYPT_SAMPLE_STRING "TRANS_ENCRY_SAMPLE_STRING"
|
||||
|
||||
@ -16,5 +16,6 @@
|
||||
extern void InitStorageConfigureNames();
|
||||
extern bool check_enable_gtm_free(bool* newval, void** extra, GucSource source);
|
||||
extern void InitializeNumLwLockPartitions(void);
|
||||
extern bool need_check_repl_uuid(GucContext ctx);
|
||||
|
||||
#endif /* GUC_STORAGE_H */
|
||||
|
||||
@ -132,7 +132,14 @@ protected:
|
||||
int m_nbuckets; /* GSC hashtable's bucket num, assigned in constructor */
|
||||
pthread_rwlock_t *m_obj_locks; /* GSC internal bucket level locks, type as array
|
||||
with length m_nbuckets */
|
||||
DllistWithLock m_dead_entries; /* List with elem removed from current GSC */
|
||||
|
||||
/* List with elem removed from current GSC, its element type couble be
|
||||
* 1. GlobalRelationEntry(for RelCache)
|
||||
* 2. GlobalPartEntry(for PartCache)
|
||||
*
|
||||
* Note: CatCache's dead list implemented in its original way
|
||||
*/
|
||||
DllistWithLock m_dead_entries;
|
||||
|
||||
pthread_rwlock_t *m_oid_locks; /* locks for GSC object, partRelOid or relOid, avoid xact
|
||||
commit thread conflict with other threads */
|
||||
|
||||
@ -65,6 +65,8 @@ class GlobalBucketList : public BaseObject {
|
||||
* GlobalSysDBCacheEntry: when use as GlobalSysDBCache:m_bucket_list
|
||||
* RelationData: when use as GlobalTabDefCache:m_bucket_list
|
||||
* PartitionData: when used as GlobalPartDefCache:m_bucket_list
|
||||
*
|
||||
* Note: CatCahe is still implemented in cc_buckets, cc_nbuckets its original style
|
||||
*/
|
||||
BucketEntry *m_bucket_entry; /* array of buckets */
|
||||
int m_nbuckets; /* array length */
|
||||
|
||||
@ -56,6 +56,19 @@ typedef struct GlobalSysCacheStat {
|
||||
pg_atomic_uint64 part_hits;
|
||||
pg_atomic_uint64 part_newloads;
|
||||
uint64 swapout_count;
|
||||
void CleanStat()
|
||||
{
|
||||
tup_searches = 0;
|
||||
tup_hits = 0;
|
||||
tup_newloads = 0;
|
||||
rel_searches = 0;
|
||||
rel_hits = 0;
|
||||
rel_newloads = 0;
|
||||
part_searches = 0;
|
||||
part_hits = 0;
|
||||
part_newloads = 0;
|
||||
swapout_count = 0;
|
||||
}
|
||||
} GlobalSysCacheStat;
|
||||
|
||||
/*
|
||||
@ -83,6 +96,9 @@ typedef struct GlobalCatalogTupleStat {
|
||||
uint64 refcount;
|
||||
} GlobalCatalogTupleStat;
|
||||
|
||||
/*
|
||||
* noen-catalog table's stat
|
||||
*/
|
||||
struct GlobalCatalogTableStat{
|
||||
Oid db_id;
|
||||
Datum db_name;
|
||||
|
||||
@ -124,7 +124,7 @@ public:
|
||||
MAX_GSC_MEMORY_SPACE = (uint64)(REAL_GSC_MEMORY_SPACE * 1.5);
|
||||
EXPECT_MAX_DB_COUNT = REAL_GSC_MEMORY_SPACE / (GLOBAL_DB_MEMORY_MIN) + 1;
|
||||
#ifdef ENABLE_LIET_MODE
|
||||
/* since gsc_rough_used_space is an esitmate of memory, reduce the upperlimit in lite mode
|
||||
/* since db_rough_used_space is an esitmate of memory, reduce the upperlimit in lite mode
|
||||
* 1.5 * 0.7 = 1.05. it is the upperlimit */
|
||||
REAL_GSC_MEMORY_SPACE = REAL_GSC_MEMORY_SPACE * 0.7;
|
||||
SAFETY_GSC_MEMORY_SPACE = SAFETY_GSC_MEMORY_SPACE * 0.7;
|
||||
@ -134,19 +134,21 @@ public:
|
||||
|
||||
inline bool StopInsertGSC()
|
||||
{
|
||||
return gsc_rough_used_space > REAL_GSC_MEMORY_SPACE;
|
||||
return GetGSCUsedMemorySpace() > REAL_GSC_MEMORY_SPACE;
|
||||
}
|
||||
|
||||
inline bool MemoryUnderControl()
|
||||
{
|
||||
return gsc_rough_used_space < SAFETY_GSC_MEMORY_SPACE;
|
||||
return GetGSCUsedMemorySpace() < SAFETY_GSC_MEMORY_SPACE;
|
||||
}
|
||||
|
||||
void Refresh(GlobalSysDBCacheEntry *entry);
|
||||
void Refresh();
|
||||
|
||||
List* GetGlobalDBStatDetail(Oid dbOid, Oid relOid, GscStatDetail stat_detail);
|
||||
void Clean(Oid dbOid);
|
||||
template <bool force>
|
||||
void ResetCache(Oid db_id);
|
||||
void InvalidAllRelations();
|
||||
void InvalidateAllRelationNodeList();
|
||||
|
||||
/* in standby mode, and wal_level is less than hot_standby, then gsc is unusable */
|
||||
bool hot_standby;
|
||||
@ -159,14 +161,16 @@ public:
|
||||
* it doesnt include the head of blocks belong to memcxt
|
||||
* for example: 1GB memcxt, and block size is 1kb, then there are 1000,000 blocks, and head of block is 64 bytes,
|
||||
* 64MB is out of estimating */
|
||||
pg_atomic_uint64 gsc_rough_used_space;
|
||||
pg_atomic_uint64 db_rough_used_space;
|
||||
pg_atomic_uint64 GetGSCUsedMemorySpace()
|
||||
{
|
||||
return db_rough_used_space + AllocSetContextUsedSpace((AllocSet)m_global_sysdb_mem_cxt);
|
||||
}
|
||||
void GSCMemThresholdCheck();
|
||||
private:
|
||||
void FreeDeadDBs();
|
||||
void HandleDeadDB(GlobalSysDBCacheEntry *exist_db);
|
||||
void SwapOutDBEntry(Index hash_index);
|
||||
void SwapOutTailBucket();
|
||||
void UpdateBucketSpace(Index hash_index);
|
||||
void FixDBName(GlobalSysDBCacheEntry *entry);
|
||||
|
||||
void CalcDynamicHashBucketStrategy();
|
||||
DynamicGSCMemoryLevel CalcDynamicGSCMemoryLevel(uint64 total_space);
|
||||
@ -211,6 +215,7 @@ private:
|
||||
/* Global memory control fields */
|
||||
MemoryContext m_global_sysdb_mem_cxt;
|
||||
|
||||
/* variables to control memory-swapping for SysDB entry */
|
||||
volatile uint32 m_is_memorychecking;
|
||||
Index m_swapout_hash_index;
|
||||
|
||||
@ -227,10 +232,15 @@ private:
|
||||
bool m_rel_store_in_shared[FirstBootstrapObjectId];
|
||||
bool m_rel_for_init_syscache[FirstNormalObjectId];
|
||||
bool m_syscache_relids[FirstNormalObjectId];
|
||||
|
||||
pthread_rwlock_t *m_special_lock;
|
||||
};
|
||||
|
||||
void NotifyGscRecoveryStarted();
|
||||
void NotifyGscRecoveryFinished();
|
||||
void NotifyGscSigHup();
|
||||
void NotifyGscHotStandby();
|
||||
void NotifyGscPgxcPoolReload();
|
||||
void NotifyGscDropDB(Oid db_id, bool need_clear);
|
||||
extern Datum gs_gsc_dbstat_info(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_gsc_clean(PG_FUNCTION_ARGS);
|
||||
extern Datum gs_gsc_catalog_detail(PG_FUNCTION_ARGS);
|
||||
|
||||
@ -120,8 +120,12 @@ private:
|
||||
* GlobalSysTabCache(in db level), with length SysCacheSize
|
||||
*/
|
||||
GlobalSysTupCache **m_global_systupcaches;
|
||||
pthread_rwlock_t *m_systab_locks;
|
||||
pthread_rwlock_t *m_systab_locks;
|
||||
|
||||
/*
|
||||
* Pointer back refers current DB object's "GlobalSysDBCacheEntry" which is held
|
||||
* as an array in GlobalSysDBCache
|
||||
*/
|
||||
struct GlobalSysDBCacheEntry *m_dbEntry;
|
||||
|
||||
/* stat info fields */
|
||||
|
||||
@ -423,7 +423,14 @@ private:
|
||||
ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for
|
||||
* heap scans */
|
||||
|
||||
/* # of hash buckets in this cache */
|
||||
/*
|
||||
* # of hash buckets in this cache
|
||||
*
|
||||
* Reminding, we may use GlobalBucketList to unifom the "bucket implementation"
|
||||
* GlobalBucketList
|
||||
* - m_bucket_entry
|
||||
* - m_nbuckets
|
||||
*/
|
||||
int cc_nbuckets;
|
||||
Dllist *cc_buckets; /* same to CatCache::cc_bucket */
|
||||
Dllist cc_lists; /* same to CatCache::cc_list */
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include "utils/relmapper.h"
|
||||
|
||||
extern bool has_locator_info(GlobalBaseEntry *entry);
|
||||
extern PartitionMap *CopyPartitionMap(PartitionMap *oldmap);
|
||||
class GlobalTabDefCache : public GlobalBaseDefCache {
|
||||
public:
|
||||
GlobalTabDefCache(Oid dbOid, bool is_shared, struct GlobalSysDBCacheEntry *entry);
|
||||
|
||||
@ -27,17 +27,22 @@
|
||||
#define KNL_LOCALSYSCACHE_COMMON_H
|
||||
#include "utils/knl_globalsyscache_common.h"
|
||||
|
||||
struct LocalBaseEntry {
|
||||
/*
|
||||
* element entry for LSC's RelCache/PartCache
|
||||
*/
|
||||
typedef struct LocalBaseEntry {
|
||||
Oid oid;
|
||||
Dlelem cache_elem;
|
||||
bool obj_is_nailed;
|
||||
};
|
||||
struct LocalPartitionEntry : LocalBaseEntry {
|
||||
} LocalBaseEntry;
|
||||
|
||||
typedef struct LocalPartitionEntry : LocalBaseEntry {
|
||||
Partition part;
|
||||
};
|
||||
struct LocalRelationEntry : LocalBaseEntry {
|
||||
} LocalPartitionEntry;
|
||||
|
||||
typedef struct LocalRelationEntry : LocalBaseEntry {
|
||||
Relation rel;
|
||||
};
|
||||
} LocalRelationEntry;
|
||||
|
||||
struct InvalidBaseEntry {
|
||||
int count;
|
||||
|
||||
@ -39,10 +39,6 @@ void ForgetRelSonMemCxtSpace(Relation rel);
|
||||
|
||||
bool CheckMyDatabaseMatch();
|
||||
|
||||
char *GetMyDatabasePath();
|
||||
Oid GetMyDatabaseId();
|
||||
Oid GetMyDatabaseTableSpace();
|
||||
|
||||
bool IsGotPoolReload();
|
||||
void ResetGotPoolReload(bool value);
|
||||
|
||||
@ -80,8 +76,6 @@ dlist_head *getUnownedReln();
|
||||
|
||||
extern void AtEOXact_SysDBCache(bool is_commit);
|
||||
|
||||
extern void ReBuildLSC();
|
||||
|
||||
struct BadPtrObj : public BaseObject {
|
||||
int nbadptr;
|
||||
void **bad_ptr_lists;
|
||||
@ -105,30 +99,36 @@ struct GSCRdLockInfo {
|
||||
pthread_rwlock_t *concurrent_lock[MAX_GSC_READLOCK_COUNT];
|
||||
};
|
||||
|
||||
enum LscInitStatus {
|
||||
LscNotInit,
|
||||
LscIniting,
|
||||
LscInitfinished
|
||||
};
|
||||
|
||||
class LocalSysDBCache : public BaseObject {
|
||||
public:
|
||||
LocalSysDBCache();
|
||||
|
||||
GlobalSysTabCache *GetGlobalSysTabCache()
|
||||
{
|
||||
if (!is_inited) {
|
||||
Init();
|
||||
if (m_global_db == NULL) {
|
||||
InitDBRef();
|
||||
}
|
||||
return m_global_db->m_systabCache;
|
||||
}
|
||||
|
||||
GlobalTabDefCache *GetGlobalTabDefCache()
|
||||
{
|
||||
if (!is_inited) {
|
||||
Init();
|
||||
if (m_global_db == NULL) {
|
||||
InitDBRef();
|
||||
}
|
||||
return m_global_db->m_tabdefCache;
|
||||
}
|
||||
|
||||
GlobalPartDefCache *GetGlobalPartDefCache()
|
||||
{
|
||||
if (!is_inited) {
|
||||
Init();
|
||||
if (m_global_db == NULL) {
|
||||
InitDBRef();
|
||||
}
|
||||
return m_global_db->m_partdefCache;
|
||||
}
|
||||
@ -202,12 +202,22 @@ public:
|
||||
MemoryContext lsc_share_memcxt;
|
||||
MemoryContext lsc_mydb_memcxt;
|
||||
/* mark whether we have loaded syscache */
|
||||
bool is_inited;
|
||||
LscInitStatus init_status;
|
||||
void ResetInitStatus()
|
||||
{
|
||||
init_status = LscNotInit;
|
||||
}
|
||||
void StartInit()
|
||||
{
|
||||
init_status = LscIniting;
|
||||
}
|
||||
void FinishInit()
|
||||
{
|
||||
init_status = LscInitfinished;
|
||||
}
|
||||
|
||||
bool recovery_finished;
|
||||
|
||||
/* used for query lsc/gsc out of transaction */
|
||||
struct ResourceOwnerData *local_sysdb_resowner;
|
||||
/* used to record multi palloc, unused for now */
|
||||
BadPtrObj bad_ptr_obj;
|
||||
/* mark lsc close flag, never query lsc if is_closed == true */
|
||||
@ -223,12 +233,20 @@ public:
|
||||
GSCRdLockInfo rdlock_info;
|
||||
double cur_swapout_ratio;
|
||||
private:
|
||||
void Init();
|
||||
void InitDBRef();
|
||||
void CreateCatBucket();
|
||||
void LocalSysDBCacheClearMyDB(Oid db_id, const char *db_name);
|
||||
void LocalSysDBCacheClearMyDB();
|
||||
bool LocalSysDBCacheNeedClearMyDB(Oid db_id, const char *db_name);
|
||||
bool DBNotMatch(Oid db_id, const char *db_name);
|
||||
bool DBStandbyChanged();
|
||||
bool LockAndAttachDBFailed();
|
||||
void FixWrongCacheStat(Oid db_id, Oid db_tabspc);
|
||||
|
||||
void LocalSysDBCacheCleanCache();
|
||||
bool LocalSysDBCacheNeedCleanCache();
|
||||
|
||||
void LocalSysDBCacheReleaseCritialReSource(bool include_shared);
|
||||
void LocalSysDBCacheResetMyDBStat();
|
||||
void SetDatabaseName(const char *db_name);
|
||||
|
||||
struct GlobalSysDBCacheEntry *m_global_db;
|
||||
@ -241,9 +259,8 @@ private:
|
||||
extern void AppendBadPtr(void *elem);
|
||||
extern void RemoveBadPtr(void *elem);
|
||||
|
||||
#define LOCAL_SYSDB_RESOWNER \
|
||||
(unlikely(t_thrd.utils_cxt.CurrentResourceOwner == NULL) ? \
|
||||
(AssertMacro(!IsTransactionOrTransactionBlock()), t_thrd.lsc_cxt.lsc->local_sysdb_resowner) \
|
||||
: t_thrd.utils_cxt.CurrentResourceOwner)
|
||||
|
||||
#define LOCAL_SYSDB_RESOWNER \
|
||||
(t_thrd.utils_cxt.CurrentResourceOwner == NULL ? t_thrd.lsc_cxt.local_sysdb_resowner : \
|
||||
t_thrd.utils_cxt.CurrentResourceOwner)
|
||||
#endif
|
||||
@ -33,7 +33,7 @@
|
||||
class LocalTabDefCache : public LocalBaseDefCache {
|
||||
public:
|
||||
LocalTabDefCache();
|
||||
void ResetInitFlag();
|
||||
void ResetInitFlag(bool include_shared);
|
||||
Relation SearchRelation(Oid rel_id);
|
||||
Relation SearchRelationFromLocal(Oid rel_id);
|
||||
template <bool insert_into_local>
|
||||
@ -149,6 +149,8 @@ private:
|
||||
|
||||
GlobalTabDefCache *m_global_tabdefcache;
|
||||
GlobalTabDefCache *m_global_shared_tabdefcache;
|
||||
|
||||
struct HTAB *PartRelCache;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -122,4 +122,8 @@ inline void SetPartCacheNeedEOXActWork(bool value)
|
||||
u_sess->cache_cxt.PartCacheNeedEOXActWork = value;
|
||||
}
|
||||
}
|
||||
|
||||
extern Relation BuildRelationFromPartRel(Relation rel, Partition part, bytea* merge_reloption);
|
||||
extern void partitionInitPartRel(Relation rel, Partition part);
|
||||
extern void SetRelationPartitionMap(Relation relation, Partition part);
|
||||
#endif
|
||||
@ -289,4 +289,6 @@ inline void EnlargeLocalRelCacheMaxBucketMapSize(double ratio)
|
||||
}
|
||||
}
|
||||
|
||||
extern void RememberToFreeTupleDescAtEOX(TupleDesc td);
|
||||
|
||||
#endif
|
||||
@ -116,6 +116,7 @@ extern char get_typtype(Oid typid);
|
||||
extern bool type_is_rowtype(Oid typid);
|
||||
extern bool type_is_enum(Oid typid);
|
||||
extern bool type_is_range(Oid typid);
|
||||
extern bool type_is_set(Oid typid);
|
||||
extern void get_type_category_preferred(Oid typid, char* typcategory, bool* typispreferred);
|
||||
extern Oid get_typ_typrelid(Oid typid);
|
||||
extern Oid get_element_type(Oid typid);
|
||||
|
||||
96
src/include/utils/mem_snapshot.h
Normal file
96
src/include/utils/mem_snapshot.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Technologies Co.,Ltd.
|
||||
*
|
||||
* openGauss is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
*
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* mem_snapshot.h
|
||||
* Memory snapshot structure definition.
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/include/mem_snapshot.h
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef MEM_SNAPSHOT_H
|
||||
#define MEM_SNAPSHOT_H
|
||||
|
||||
#include "postgres.h"
|
||||
#include "knl/knl_variable.h"
|
||||
#include "catalog/catalog.h"
|
||||
#include "catalog/pg_authid.h"
|
||||
#include "catalog/pg_tablespace.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "funcapi.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/elog.h"
|
||||
#include "utils/acl.h"
|
||||
#include "miscadmin.h"
|
||||
#include "threadpool/threadpool.h"
|
||||
#include "storage/proc.h"
|
||||
#include "utils/memprot.h"
|
||||
#include "pgtime.h"
|
||||
#include "pgstat.h"
|
||||
#include "postmaster/fork_process.h"
|
||||
#include "postmaster/postmaster.h"
|
||||
#include "postmaster/syslogger.h"
|
||||
#include "cjson/cJSON.h"
|
||||
|
||||
typedef struct MemoryDumpData {
|
||||
char *contextName;
|
||||
Size freeSize;
|
||||
Size totalSize;
|
||||
} MemoryDumpData;
|
||||
|
||||
typedef enum DumpMemoryType{
|
||||
MEMORY_CONTEXT_SHARED,
|
||||
MEMORY_CONTEXT_SESSION,
|
||||
MEMORY_CONTEXT_THREAD
|
||||
} DumpMemoryType;
|
||||
|
||||
typedef enum {
|
||||
MEMORY_TRACE_NONE = 0,
|
||||
MEMORY_TRACE_LEVEL1,
|
||||
MEMORY_TRACE_LEVEL2,
|
||||
} MemoryTraceLevel;
|
||||
|
||||
|
||||
#define RESET_PERCENT_KIND 2
|
||||
#define PERCENT_LOW_KIND 0
|
||||
#define PERCENT_HIGH_KIND 1
|
||||
|
||||
#define MEMORY_TRACE_PERCENT 90
|
||||
#define FULL_PERCENT 100
|
||||
#define MAX_WAIT_COUNT 10
|
||||
|
||||
#define TOP_MEMORY_CONTEXT_NUM 20
|
||||
|
||||
#define MAX_INT_NUM_LEN 10
|
||||
|
||||
extern void check_stack_depth(void);
|
||||
extern int kill_backend(ThreadId tid, bool checkPermission);
|
||||
char* GetRoleName(Oid rolid, char* rolname, size_t size);
|
||||
|
||||
void RecursiveSharedMemoryContext(const MemoryContext context, StringInfoDataHuge* buf, bool isShared);
|
||||
void RecursiveUnSharedMemoryContext(const MemoryContext context, StringInfoDataHuge* buf);
|
||||
void ExecOverloadEscape();
|
||||
void InitMemoryLogDirectory();
|
||||
|
||||
void AssignThreadpoolResetPercent(const char* newval, void* extra);
|
||||
bool CheckThreadpoolResetPercent(char** newval, void** extra, GucSource source);
|
||||
void AssignMemoryResetPercent(const char* newval, void* extra);
|
||||
bool CheckMemoryResetPercent(char** newval, void** extra, GucSource source);
|
||||
|
||||
|
||||
#endif /* MEM_SNAPSHOT_H */
|
||||
@ -82,7 +82,6 @@ extern void PartitionCacheInvalidate(void);
|
||||
extern void PartitionCloseSmgrByOid(Oid partitionId);
|
||||
extern void AtEOXact_PartitionCache(bool isCommit);
|
||||
extern void AtEOSubXact_PartitionCache(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid);
|
||||
extern void UpdatePartrelPointer(Relation partrel, Relation rel, Partition part);
|
||||
extern Relation partitionGetRelation(Relation rel, Partition part);
|
||||
|
||||
void releaseDummyRelation(Relation* relation);
|
||||
|
||||
@ -60,9 +60,9 @@ extern List* untransformPartitionBoundary(Datum options);
|
||||
*/
|
||||
extern void CheckValuePartitionKeyType(Form_pg_attribute* attrs, List* pos);
|
||||
|
||||
extern Oid getPartitionOidForRTE(RangeTblEntry *rte, RangeVar *relation, ParseState *pstate, Relation rel);
|
||||
extern Oid GetSubPartitionOidForRTE(RangeTblEntry *rte, RangeVar *relation, ParseState *pstate, Relation rel,
|
||||
Oid *partOid);
|
||||
extern bool GetPartitionOidForRTE(RangeTblEntry *rte, RangeVar *relation, ParseState *pstate, Relation rel);
|
||||
extern bool GetSubPartitionOidForRTE(RangeTblEntry *rte, RangeVar *relation, ParseState *pstate, Relation rel);
|
||||
extern void GetPartitionOidListForRTE(RangeTblEntry *rte, RangeVar *relation);
|
||||
|
||||
#define partitonKeyCompareForRouting(value1, value2, len, compare) \
|
||||
do { \
|
||||
|
||||
@ -103,7 +103,7 @@ extern int partOidGetPartSequence(Relation rel, Oid partOid);
|
||||
extern Oid getListPartitionOid(PartitionMap* partitionmap, Const** partKeyValue, int* partIndex, bool topClosed);
|
||||
extern Oid getHashPartitionOid(PartitionMap* partitionmap, Const** partKeyValue, int* partIndex, bool topClosed);
|
||||
extern Oid getRangePartitionOid(PartitionMap* partitionmap, Const** partKeyValue, int* partIndex, bool topClosed);
|
||||
extern Oid GetPartitionOidByParam(Relation relation, Param *paramArg, ParamExternData *prm);
|
||||
extern Oid GetPartitionOidByParam(PartitionMap* partitionmap, Param *paramArg, ParamExternData *prm);
|
||||
extern List* getRangePartitionBoundaryList(Relation rel, int sequence);
|
||||
extern List* getListPartitionBoundaryList(Relation rel, int sequence);
|
||||
extern List* getHashPartitionBoundaryList(Relation rel, int sequence);
|
||||
|
||||
@ -480,6 +480,7 @@ typedef struct PruningResult {
|
||||
Expr* expr;
|
||||
/* This variable applies only to single-partition key range partition tables in PBE mode. */
|
||||
bool isPbeSinlePartition = false;
|
||||
PartitionMap* partMap;
|
||||
} PruningResult;
|
||||
|
||||
extern Oid partIDGetPartOid(Relation relation, PartitionIdentifier* partID);
|
||||
@ -487,6 +488,7 @@ extern PartitionIdentifier* partOidGetPartID(Relation rel, Oid partOid);
|
||||
|
||||
extern void RebuildPartitonMap(PartitionMap* oldMap, PartitionMap* newMap);
|
||||
extern void RebuildRangePartitionMap(RangePartitionMap* oldMap, RangePartitionMap* newMap);
|
||||
extern bool EqualPartitonMap(const PartitionMap* partMap1, const PartitionMap* partMap2);
|
||||
|
||||
bool isPartKeyValuesInPartition(RangePartitionMap* partMap, Const** partKeyValues, int partkeyColumnNum, int partSeq);
|
||||
|
||||
@ -508,6 +510,8 @@ extern int HashElementCmp(const void* a, const void* b);
|
||||
extern void DestroyListElements(ListPartElement* src, int elementNum);
|
||||
extern void PartitionMapDestroyHashArray(HashPartElement* hashArray, int arrLen);
|
||||
extern void partitionMapDestroyRangeArray(RangeElement* rangeArray, int arrLen);
|
||||
extern void RelationDestroyPartitionMap(PartitionMap* partMap);
|
||||
extern void DestroyPartitionMap(PartitionMap* partMap);
|
||||
extern bool trySearchFakeReationForPartitionOid(HTAB** fakeRels, MemoryContext cxt, Relation rel, Oid partOid,
|
||||
Relation* fakeRelation, Partition* partition, LOCKMODE lmode, bool checkSubPart = true);
|
||||
|
||||
#endif /* PARTITIONMAP_GS_H_ */
|
||||
|
||||
@ -1,75 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
*
|
||||
* openGauss is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
*
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* pl_package.h
|
||||
* Definition about package.
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/common/pl/plpgsql/src/pl_package.h
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef PL_PACKAGE_H
|
||||
#define PL_PACKAGE_H
|
||||
#include "utils/plpgsql.h"
|
||||
|
||||
|
||||
|
||||
extern bool check_search_path_interface(List *schemas, HeapTuple proc_tup);
|
||||
|
||||
|
||||
extern PLpgSQL_package* plpgsql_pkg_HashTableLookup(PLpgSQL_pkg_hashkey* pkg_key);
|
||||
|
||||
extern void delete_package(PLpgSQL_package* pkg);
|
||||
|
||||
extern bool plpgsql_check_opexpr_colocate(
|
||||
Query* query, List* qry_part_attr_num, List* trig_part_attr_num, PLpgSQL_function* func, List* opexpr_list);
|
||||
|
||||
extern bool plpgsql_check_updel_colocate(
|
||||
Query* query, List* qry_part_attr_num, List* trig_part_attr_num, PLpgSQL_function* func);
|
||||
|
||||
extern bool check_search_path_interface(List *schemas, HeapTuple proc_tup);
|
||||
|
||||
extern void plpgsql_compile_error_callback(void* arg);
|
||||
|
||||
extern Oid findPackageParameter(const char* objname);
|
||||
|
||||
extern int plpgsql_getCustomErrorCode(void);
|
||||
|
||||
extern PLpgSQL_row* build_row_from_class(Oid class_oid);
|
||||
|
||||
extern int GetLineNumber(const char* procedureStr, int loc);
|
||||
|
||||
extern int GetProcedureLineNumberInPackage(const char* procedureStr, int loc);
|
||||
|
||||
extern void InsertError(Oid objId);
|
||||
|
||||
extern int CompileWhich();
|
||||
|
||||
extern void InsertErrorMessage(const char* message, int yyloc, bool isQueryString = false, int lines = 0);
|
||||
|
||||
extern void DropErrorByOid(int objtype, Oid objoid);
|
||||
|
||||
extern bool IsOnlyCompilePackage();
|
||||
|
||||
extern HeapTuple getCursorTypeTup(const char* word);
|
||||
|
||||
extern List* GetPackageListName(const char* pkgName, const Oid nspOid);
|
||||
|
||||
extern HeapTuple getPLpgsqlVarTypeTup(char* word);
|
||||
|
||||
extern HeapTuple FindRowVarColType(List* nameList);
|
||||
#endif
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
*
|
||||
* openGauss is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
*
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* pl_package.h
|
||||
* Definition about package.
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/common/pl/plpgsql/src/pl_package.h
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef PL_PACKAGE_H
|
||||
#define PL_PACKAGE_H
|
||||
#include "utils/plpgsql.h"
|
||||
|
||||
|
||||
|
||||
extern bool check_search_path_interface(List *schemas, HeapTuple proc_tup);
|
||||
|
||||
|
||||
extern PLpgSQL_package* plpgsql_pkg_HashTableLookup(PLpgSQL_pkg_hashkey* pkg_key);
|
||||
|
||||
extern void delete_package(PLpgSQL_package* pkg);
|
||||
|
||||
extern bool plpgsql_check_opexpr_colocate(
|
||||
Query* query, List* qry_part_attr_num, List* trig_part_attr_num, PLpgSQL_function* func, List* opexpr_list);
|
||||
|
||||
extern bool plpgsql_check_updel_colocate(
|
||||
Query* query, List* qry_part_attr_num, List* trig_part_attr_num, PLpgSQL_function* func);
|
||||
|
||||
extern bool check_search_path_interface(List *schemas, HeapTuple proc_tup);
|
||||
|
||||
extern void plpgsql_compile_error_callback(void* arg);
|
||||
|
||||
extern Oid findPackageParameter(const char* objname);
|
||||
|
||||
extern int plpgsql_getCustomErrorCode(void);
|
||||
|
||||
extern PLpgSQL_row* build_row_from_class(Oid class_oid);
|
||||
|
||||
extern int GetLineNumber(const char* procedureStr, int loc);
|
||||
|
||||
extern int GetProcedureLineNumberInPackage(const char* procedureStr, int loc);
|
||||
|
||||
extern void InsertError(Oid objId);
|
||||
|
||||
extern int CompileWhich();
|
||||
|
||||
extern void InsertErrorMessage(const char* message, int yyloc, bool isQueryString = false, int lines = 0);
|
||||
|
||||
extern void DropErrorByOid(int objtype, Oid objoid);
|
||||
|
||||
extern bool IsOnlyCompilePackage();
|
||||
|
||||
extern HeapTuple getCursorTypeTup(const char* word);
|
||||
|
||||
extern List* GetPackageListName(const char* pkgName, const Oid nspOid);
|
||||
|
||||
extern HeapTuple getPLpgsqlVarTypeTup(char* word);
|
||||
|
||||
extern HeapTuple FindRowVarColType(List* nameList, int* collectionType = NULL, Oid* tableofIndexType = NULL);
|
||||
#endif
|
||||
|
||||
@ -35,6 +35,12 @@ namespace JitExec
|
||||
#define CACHEDPLANSOURCE_MAGIC 195726186
|
||||
#define CACHEDPLAN_MAGIC 953717834
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
#define ENABLE_CACHEDPLAN_MGR (IS_SINGLE_NODE && g_instance.attr.attr_common.enable_cachedplan_mgr && !ENABLE_GPC)
|
||||
#else
|
||||
#define ENABLE_CACHEDPLAN_MGR false
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MOT
|
||||
/* different storage engine types that might be used by a query */
|
||||
typedef enum {
|
||||
@ -242,6 +248,46 @@ typedef struct SPISign
|
||||
int plansource_id; /* plansource idx in spiplan's plancache_list */
|
||||
} SPISign;
|
||||
|
||||
typedef struct PlanManager PlanManager;
|
||||
typedef struct CachedPlanInfo CachedPlanInfo;
|
||||
|
||||
typedef enum {
|
||||
ADPT_PLAN_UNCHECKED = 0x01,
|
||||
ADPT_PLAN_SURVIVAL = 0x02,
|
||||
ADPT_PLAN_KNOCKOUT = 0x04
|
||||
} AdaptCachedPlanStat;
|
||||
|
||||
typedef enum {
|
||||
PMGR_START,
|
||||
PMGR_EXPLORE_PLAN,
|
||||
PMGR_CHOOSE_BEST_METHOD,
|
||||
PMGR_USE_MINICOST,
|
||||
PMGR_USE_MATCH,
|
||||
PMGR_CHECK_PLAN,
|
||||
PMGR_FINISH,
|
||||
} PMGRActionType;
|
||||
|
||||
typedef enum {
|
||||
PMGR_GET_NONE_STATS,
|
||||
PMGR_STMT_EXEC_STATS,
|
||||
PMGR_PLAN_EXEC_STATS,
|
||||
}PMGRStatCollectType;
|
||||
|
||||
typedef struct PMGRAction{
|
||||
PMGRActionType type;
|
||||
CachedPlanSource *psrc;
|
||||
CachedPlan *selected_plan;
|
||||
bool valid_plan;
|
||||
PMGRStatCollectType statType;
|
||||
bool is_shared; /* plansource is shared or not? */
|
||||
int lock_id; /* lockid of the current plansource */
|
||||
bool is_lock;
|
||||
LWLockMode lockmode;
|
||||
bool needGenericRoot;
|
||||
uint8 step;
|
||||
}PMGRAction;
|
||||
|
||||
|
||||
/*
|
||||
* CachedPlanSource (which might better have been called CachedQuery)
|
||||
* represents a SQL query that we expect to use multiple times. It stores
|
||||
@ -359,6 +405,10 @@ typedef struct CachedPlanSource {
|
||||
bool force_custom_plan; /* force to use custom plan */
|
||||
bool single_shard_stmt; /* single shard stmt? */
|
||||
#endif
|
||||
uint64 sql_patch_sequence; /* should match g_instance.cost_cxt.sql_patch_sequence_id */
|
||||
PlanManager *planManager;
|
||||
int gpc_lockid;
|
||||
int nextval_default_expr_type;
|
||||
} CachedPlanSource;
|
||||
|
||||
/*
|
||||
@ -401,8 +451,61 @@ typedef struct CachedPlan {
|
||||
pg_memory_barrier();
|
||||
return is_share;
|
||||
}
|
||||
CachedPlanInfo *cpi;
|
||||
bool is_candidate;
|
||||
} CachedPlan;
|
||||
|
||||
typedef struct CachedPlanInfo {
|
||||
NodeTag type;
|
||||
List *relCis; /* list of relCI(s)*/
|
||||
List *indexCis; /* list of IndexCI(s) */
|
||||
void *offsetCi;
|
||||
double learningRate;
|
||||
CachedPlan *plan;
|
||||
uint32 planHashkey;
|
||||
volatile uint32 verification_times;
|
||||
volatile uint64 sample_exec_costs;
|
||||
volatile uint32 sample_times;
|
||||
AdaptCachedPlanStat status;
|
||||
bool usePartIdx;
|
||||
} CachedPlanInfo;
|
||||
|
||||
/* Gplan selection method */
|
||||
typedef enum GplanSelectionMethod {
|
||||
CHOOSE_NONE_GPLAN,
|
||||
CHOOSE_DEFAULT_GPLAN,
|
||||
CHOOSE_MINCOST_GPLAN,
|
||||
CHOOSE_ADAPTIVE_GPLAN
|
||||
} GplanSelectionMethod;
|
||||
|
||||
typedef struct PlanManager {
|
||||
GplanSelectionMethod method;
|
||||
List *candidatePlans; /* list of CachedPlanInfo */
|
||||
bool is_valid; /* is valid? not used */
|
||||
MemoryContext context; /* context of root */
|
||||
|
||||
/*
|
||||
* explored plan actually is a parametric cplan which is generated by
|
||||
* planner. Assume that planner always returns best plans. Plan selection
|
||||
* module begins with a set of plan explorations, and computes the average
|
||||
* execution time of the plans as the benchmark of stmt executions.
|
||||
*
|
||||
* explore_exec_costs: the total execution times of queries being explored.
|
||||
* explore_times: number of the explorations.
|
||||
*/
|
||||
volatile uint64 explore_exec_costs; /* unit: microsecond */
|
||||
volatile uint32 explore_times;
|
||||
CachedPlan *mini_cost_plan;
|
||||
|
||||
/*
|
||||
* Search key of the plancache list. When the list is shared in session
|
||||
* level, psrc_key is the same to plansource->stmt_name; while the list
|
||||
* is shared at instance level, psrc_key is reset by a global plansource
|
||||
* hashkey.
|
||||
*/
|
||||
char psrc_key[NAMEDATALEN];
|
||||
} PlanManager;
|
||||
|
||||
extern void InitPlanCache(void);
|
||||
extern void ResetPlanCache(void);
|
||||
|
||||
@ -429,6 +532,7 @@ extern bool CachedPlanIsValid(CachedPlanSource* plansource);
|
||||
|
||||
extern List* CachedPlanGetTargetList(CachedPlanSource* plansource);
|
||||
|
||||
extern CachedPlan* GetWiseCachedPlan(CachedPlanSource* plansource, ParamListInfo boundParams, bool useResOwner);
|
||||
extern CachedPlan* GetCachedPlan(CachedPlanSource* plansource, ParamListInfo boundParams, bool useResOwner);
|
||||
extern void ReleaseCachedPlan(CachedPlan* plan, bool useResOwner);
|
||||
extern void DropCachedPlanInternal(CachedPlanSource* plansource);
|
||||
@ -446,4 +550,13 @@ extern void AcquirePlannerLocks(List* stmt_list, bool acquire);
|
||||
extern void AcquireExecutorLocks(List* stmt_list, bool acquire);
|
||||
extern bool CachedPlanAllowsSimpleValidityCheck(CachedPlanSource *plansource, CachedPlan *plan, ResourceOwner owner);
|
||||
extern bool CachedPlanIsSimplyValid(CachedPlanSource *plansource, CachedPlan *plan, ResourceOwner owner);
|
||||
|
||||
extern bool CheckCachedPlan(CachedPlanSource* plansource, CachedPlan *plan);
|
||||
extern double cached_plan_cost(CachedPlan* plan);
|
||||
extern void ReportReasonForPlanChoose(PlanChooseReason reason);
|
||||
extern CachedPlan* BuildCachedPlan(CachedPlanSource* plansource, List* qlist, ParamListInfo boundParams,
|
||||
bool isBuildingCustomPlan);
|
||||
extern void ReleaseGenericPlan(CachedPlanSource* plansource);
|
||||
extern bool ChooseCustomPlan(CachedPlanSource* plansource, ParamListInfo boundParams);
|
||||
|
||||
#endif /* PLANCACHE_H */
|
||||
|
||||
@ -1134,6 +1134,7 @@ typedef struct PLpgSQL_execstate { /* Runtime execution data */
|
||||
|
||||
int64 stack_entry_start; /* ExprContext's starting number for eval simple expression */
|
||||
Oid curr_nested_table_type;
|
||||
int curr_nested_table_layers;
|
||||
bool is_exception;
|
||||
} PLpgSQL_execstate;
|
||||
|
||||
@ -1157,6 +1158,16 @@ typedef struct PLpgSQL_func_tableof_index {
|
||||
HTAB* tableOfIndex;
|
||||
} PLpgSQL_func_tableof_index;
|
||||
|
||||
typedef struct ExecTableOfIndexInfo {
|
||||
ExprContext* econtext;
|
||||
HTAB* tableOfIndex;
|
||||
Oid tableOfIndexType;
|
||||
bool isnestedtable;
|
||||
int tableOfLayers;
|
||||
int paramid;
|
||||
Oid paramtype;
|
||||
} ExecTableOfIndexInfo;
|
||||
|
||||
/*
|
||||
* A PLpgSQL_plugin structure represents an instrumentation plugin.
|
||||
* To instrument PL/pgSQL, a plugin library must access the rendezvous
|
||||
@ -1199,9 +1210,10 @@ typedef struct PLpgSQL_plugin {
|
||||
/* Function pointers set by PL/pgSQL itself */
|
||||
void (*error_callback)(void* arg);
|
||||
void (*assign_expr)(PLpgSQL_execstate* estate, PLpgSQL_datum* target, PLpgSQL_expr* expr);
|
||||
Datum (*eval_expr)(PLpgSQL_execstate* estate, PLpgSQL_expr* expr, bool* isNull, Oid* rettype, HTAB** tableOfIndex);
|
||||
Datum (*eval_expr)(PLpgSQL_execstate* estate, PLpgSQL_expr* expr, bool* isNull, Oid* rettype,
|
||||
HTAB** tableOfIndex, ExecTableOfIndexInfo* tableOfIndexInfo);
|
||||
void (*assign_value)(PLpgSQL_execstate* estate, PLpgSQL_datum* target, Datum value,
|
||||
Oid valtype, bool* isNull, HTAB* tableOfIndex);
|
||||
Oid valtype, bool* isNull, HTAB* tableOfIndex, ExecTableOfIndexInfo* tableOfIndexInfo);
|
||||
void (*eval_cleanup)(PLpgSQL_execstate* estate);
|
||||
int (*validate_line)(PLpgSQL_stmt_block* block, int linenum);
|
||||
} PLpgSQL_plugin;
|
||||
@ -1287,15 +1299,6 @@ typedef struct PLpgSQL_package { /* Complete compiled package */
|
||||
bool isInit;
|
||||
} PLpgSQL_package;
|
||||
|
||||
typedef struct ExecTableOfIndexInfo {
|
||||
ExprContext* econtext;
|
||||
HTAB* tableOfIndex;
|
||||
Oid tableOfIndexType;
|
||||
bool isnestedtable;
|
||||
int tableOfLayers;
|
||||
int paramid;
|
||||
Oid paramtype;
|
||||
} ExecTableOfIndexInfo;
|
||||
|
||||
/**********************************************************************
|
||||
* Pl debugger
|
||||
@ -1636,7 +1639,7 @@ extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid, Sub
|
||||
|
||||
extern Oid exec_get_datum_type(PLpgSQL_execstate* estate, PLpgSQL_datum* datum);
|
||||
extern void exec_get_datum_type_info(PLpgSQL_execstate* estate, PLpgSQL_datum* datum, Oid* typid, int32* typmod,
|
||||
Oid* collation, Oid* tableOfIndexType, PLpgSQL_function* func = NULL);
|
||||
Oid* collation, List** tableOfIndexType, PLpgSQL_function* func = NULL);
|
||||
extern Datum exec_simple_cast_datum(
|
||||
PLpgSQL_execstate* estate, Datum value, Oid valtype, Oid reqtype, int32 reqtypmod, bool isnull);
|
||||
extern void ResetCursorOption(Portal portal, bool reset);
|
||||
@ -1646,7 +1649,8 @@ extern void ResetCursorAtrribute(Portal portal);
|
||||
#endif
|
||||
extern void exec_assign_value(PLpgSQL_execstate *estate,
|
||||
PLpgSQL_datum *target,
|
||||
Datum value, Oid valtype, bool *isNull, HTAB* tableOfIndex = NULL);
|
||||
Datum value, Oid valtype, bool *isNull, HTAB* tableOfIndex = NULL,
|
||||
ExecTableOfIndexInfo* tableOfIndexInfo = NULL);
|
||||
extern void exec_eval_datum(PLpgSQL_execstate *estate,
|
||||
PLpgSQL_datum *datum,
|
||||
Oid *typeId,
|
||||
@ -1666,6 +1670,7 @@ extern void CheckCurrCompileDependOnPackage(Oid pkgOid);
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
extern void estate_cursor_set(FormatCallStack* plcallstack);
|
||||
#endif
|
||||
extern Datum ExecEvalArrayRef(ArrayRefExprState* astate, ExprContext* econtext, bool* isNull, ExprDoneCond* isDone);
|
||||
|
||||
/* ----------
|
||||
* Functions for namespace handling in pl_funcs.c
|
||||
@ -1683,6 +1688,9 @@ extern void plpgsql_ns_additem(
|
||||
extern PLpgSQL_nsitem* plpgsql_ns_lookup(
|
||||
PLpgSQL_nsitem* ns_cur, bool localmode, const char* name1, const char* name2, const char* name3, int* names_used);
|
||||
extern PLpgSQL_nsitem* plpgsql_ns_lookup_label(PLpgSQL_nsitem* ns_cur, const char* name);
|
||||
extern void free_func_tableof_index();
|
||||
extern void free_temp_func_tableof_index(List* temp_tableof_index);
|
||||
|
||||
|
||||
/* ----------
|
||||
* Other functions in pl_funcs.c
|
||||
@ -1854,5 +1862,6 @@ extern void stp_reset_xact();
|
||||
extern void stp_reset_stmt();
|
||||
extern void stp_reserve_subxact_resowner(ResourceOwner resowner);
|
||||
extern void stp_cleanup_subxact_resowner(int64 minStackId);
|
||||
|
||||
extern void stp_cleanup_subxact_resource(int64 stackId);
|
||||
extern void InsertGsSource(Oid objId, Oid nspid, const char* name, const char* type, bool status);
|
||||
#endif /* PLPGSQL_H */
|
||||
|
||||
@ -125,6 +125,15 @@ typedef struct PortalStream {
|
||||
query_id = 0;
|
||||
}
|
||||
|
||||
void ResetEnv()
|
||||
{
|
||||
t_thrd.subrole = NO_SUBROLE;
|
||||
u_sess->stream_cxt.global_obj = NULL;
|
||||
u_sess->stream_cxt.stream_runtime_mem_cxt = NULL;
|
||||
u_sess->stream_cxt.data_exchange_mem_cxt = NULL;
|
||||
u_sess->debug_query_id = 0;
|
||||
}
|
||||
|
||||
void RecordSessionInfo()
|
||||
{
|
||||
streamGroup = u_sess->stream_cxt.global_obj;
|
||||
@ -233,11 +242,17 @@ typedef struct PortalData {
|
||||
int funcUseCount;
|
||||
MemoryContext copyCxt; /* memory for gpc copy plan */
|
||||
bool is_from_spi;
|
||||
/*
|
||||
* have_rollback_transaction parameter has dirty read and rollback is available.
|
||||
* This parameter is used to report an error when the cursor is rolled back.
|
||||
*/
|
||||
bool have_rollback_transaction;
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
PortalStream streamInfo;
|
||||
bool isAutoOutParam; /* is autonomous transaction procedure out param? */
|
||||
bool isPkgCur; /* cursor variable is a package variable? */
|
||||
#endif
|
||||
int nextval_default_expr_type; /* nextval does not support lightproxy and sqlbypass */
|
||||
} PortalData;
|
||||
|
||||
/*
|
||||
@ -263,7 +278,7 @@ extern void AtSubCommit_Portals(SubTransactionId mySubid, SubTransactionId paren
|
||||
extern void AtSubAbort_Portals(SubTransactionId mySubid, SubTransactionId parentSubid,
|
||||
ResourceOwner myXactOwner, ResourceOwner parentXactOwner, bool inSTP);
|
||||
extern void AtSubCleanup_Portals(SubTransactionId mySubid);
|
||||
extern Portal CreatePortal(const char* name, bool allowDup, bool dupSilent, bool is_from_spi = false);
|
||||
extern Portal CreatePortal(const char* name, bool allowDup, bool dupSilent, bool is_from_spi = false, bool is_from_pbe = false);
|
||||
extern Portal CreateNewPortal(bool is_from_spi = false);
|
||||
extern void PinPortal(Portal portal);
|
||||
extern void UnpinPortal(Portal portal);
|
||||
@ -279,6 +294,6 @@ extern void PortalCreateHoldStore(Portal portal);
|
||||
extern void PortalHashTableDeleteAll(void);
|
||||
extern bool ThereAreNoReadyPortals(void);
|
||||
extern void ResetPortalCursor(SubTransactionId mySubid, Oid funOid, int funUseCount, bool reset = true);
|
||||
extern void HoldPinnedPortals(void);
|
||||
extern void HoldPortal(Portal portal);
|
||||
extern void HoldPinnedPortals(bool is_rollback = false);
|
||||
extern void HoldPortal(Portal portal, bool is_rollback = false);
|
||||
#endif /* PORTAL_H */
|
||||
|
||||
@ -78,6 +78,8 @@ public:
|
||||
|
||||
void InitCsnminSync();
|
||||
|
||||
void InitCfsShrinker();
|
||||
|
||||
void InitTxnSnapCapturer();
|
||||
|
||||
void InitTxnSnapWorker();
|
||||
@ -112,7 +114,7 @@ public:
|
||||
|
||||
void InitUndoLauncher();
|
||||
|
||||
void InitUndoWorker();
|
||||
bool InitUndoWorker();
|
||||
|
||||
void InitBarrierCreator();
|
||||
|
||||
@ -123,6 +125,7 @@ public:
|
||||
void InitApplyLauncher();
|
||||
|
||||
void InitApplyWorker();
|
||||
void InitStackPerfWorker();
|
||||
|
||||
public:
|
||||
const char* m_indbname;
|
||||
@ -208,4 +211,6 @@ private:
|
||||
|
||||
void ShutdownPostgres(int code, Datum arg);
|
||||
|
||||
extern HeapTuple GetDatabaseTupleByOid(Oid dboid);
|
||||
|
||||
#endif /* UTILS_POSTINIT_H */
|
||||
|
||||
@ -152,6 +152,7 @@ typedef struct RelationData {
|
||||
TupleDesc rd_att; /* tuple descriptor */
|
||||
Oid rd_id; /* relation's object id */
|
||||
bool rd_isblockchain; /* relation is in blockchain schema */
|
||||
char relreplident; /* see REPLICA_IDENTITY_xxx constants */
|
||||
|
||||
LockInfoData rd_lockInfo; /* lock mgr's info for locking relation */
|
||||
RuleLock* rd_rules; /* rewrite rules */
|
||||
@ -292,8 +293,9 @@ typedef struct RelationData {
|
||||
bool newcbi;
|
||||
|
||||
bool is_compressed;
|
||||
bool come_from_partrel;
|
||||
/* used only for gsc, keep it preserved if you modify the rel, otherwise set it null */
|
||||
struct LocalRelationEntry *entry;
|
||||
struct LocalRelationEntry *entry;
|
||||
} RelationData;
|
||||
|
||||
/*
|
||||
@ -332,10 +334,8 @@ typedef enum RedisRelAction {
|
||||
|
||||
/* PageCompressOpts->compressType values */
|
||||
typedef enum CompressTypeOption {
|
||||
COMPRESS_TYPE_NONE = 0, COMPRESS_TYPE_PGLZ = 1, COMPRESS_TYPE_ZSTD = 2
|
||||
COMPRESS_TYPE_NONE = 0, COMPRESS_TYPE_PGLZ = 1, COMPRESS_TYPE_ZSTD = 2, COMPRESS_TYPE_PGZSTD = 3
|
||||
} CompressTypeOption;
|
||||
|
||||
|
||||
typedef struct StdRdOptions {
|
||||
int32 vl_len_; /* varlena header (do not touch directly!) */
|
||||
int fillfactor; /* page fill factor in percent (0..100) */
|
||||
@ -612,6 +612,7 @@ extern TransactionId PartGetRelFrozenxid64(Partition part);
|
||||
*/
|
||||
#define RelationIsMapped(relation) ((relation)->rd_rel->relfilenode == InvalidOid)
|
||||
|
||||
extern void TryFreshSmgrCache(struct SMgrRelationData *smgr);
|
||||
/*
|
||||
* RelationOpenSmgr
|
||||
* Open the relation at the smgr level, if not already done.
|
||||
@ -620,6 +621,9 @@ extern TransactionId PartGetRelFrozenxid64(Partition part);
|
||||
do { \
|
||||
if ((relation)->rd_smgr == NULL) \
|
||||
smgrsetowner(&((relation)->rd_smgr), smgropen((relation)->rd_node, (relation)->rd_backend)); \
|
||||
else { \
|
||||
TryFreshSmgrCache((relation)->rd_smgr); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
|
||||
@ -79,7 +79,7 @@ typedef struct PartitionData {
|
||||
SubTransactionId pd_createSubid; /* rel was created in current xact */
|
||||
SubTransactionId pd_newRelfilenodeSubid; /* new relfilenode assigned in
|
||||
* current xact */
|
||||
|
||||
Relation partrel; /* a temprary relation generated by the partition itself and it's parent relation */
|
||||
Form_pg_partition pd_part; /* PARTITION tuple */
|
||||
Oid pd_id; /* partition's object id */
|
||||
List* pd_indexlist; /* list of OIDs of indexes on partition */
|
||||
@ -101,7 +101,6 @@ typedef struct PartitionData {
|
||||
struct PgStat_TableStatus* pd_pgstat_info; /* statistics collection area */
|
||||
Partition parent;
|
||||
bool newcbi;
|
||||
Relation partrel; /* a temprary relation generated by the partition itself and it's parent relation */
|
||||
PartitionMap* partMap; /* For Level-1 partition of subpartition table */
|
||||
struct LocalPartitionEntry *entry;
|
||||
CommitSeqNo xmin_csn; /* the commit sequence number when the xmin of tuple commit */
|
||||
@ -273,13 +272,10 @@ static inline TableAmType get_tableam_from_reloptions(bytea* reloptions, char re
|
||||
*/
|
||||
static inline int8 get_indexsplit_from_reloptions(bytea *reloptions, Oid amoid)
|
||||
{
|
||||
if (reloptions != NULL && amoid == UBTREE_AM_OID &&
|
||||
!(RelationIsIndexsplitMethodDefault(reloptions)) &&
|
||||
RelationIsIndexsplitMethodInsertpt(reloptions)) {
|
||||
return INDEXSPLIT_NO_INSERTPT;
|
||||
} else { /* For System Tables reloptions can be NULL. */
|
||||
return INDEXSPLIT_NO_DEFAULT;
|
||||
if (reloptions != NULL && (amoid == BTREE_AM_OID || amoid == UBTREE_AM_OID)) {
|
||||
return (RelationIsIndexsplitMethodInsertpt(reloptions) ? INDEXSPLIT_NO_INSERTPT : INDEXSPLIT_NO_DEFAULT);
|
||||
}
|
||||
return (amoid == UBTREE_AM_OID ? INDEXSPLIT_NO_INSERTPT : INDEXSPLIT_NO_DEFAULT);
|
||||
}
|
||||
/* RelationGetOrientation
|
||||
* Return the relations' orientation
|
||||
@ -385,8 +381,6 @@ static inline RedisHtlAction RelationGetAppendMode(Relation rel)
|
||||
#define RelationIsColStore(relation) \
|
||||
((RELKIND_RELATION == relation->rd_rel->relkind) && (RelationIsCUFormat(relation) || RelationIsPAXFormat(relation)))
|
||||
|
||||
#define RelationOptionIsDfsStore(optionValue) (optionValue && 0 == pg_strncasecmp(optionValue, HDFS, strlen(HDFS)))
|
||||
|
||||
#define RelationIsTsStore(relation) \
|
||||
((RELKIND_RELATION == relation->rd_rel->relkind) && \
|
||||
pg_strcasecmp(RelationGetOrientation(relation), ORIENTATION_TIMESERIES) == 0)
|
||||
@ -479,6 +473,9 @@ static inline bool RelationCreateInCurrXact(Relation rel)
|
||||
do { \
|
||||
if ((partition)->pd_smgr == NULL) \
|
||||
smgrsetowner(&((partition)->pd_smgr), smgropen((partition)->pd_node, InvalidBackendId)); \
|
||||
else { \
|
||||
TryFreshSmgrCache((partition)->pd_smgr); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
@ -573,6 +570,7 @@ extern void PartitionDecrementReferenceCount(Partition part);
|
||||
SMgrRelation tmp; \
|
||||
tmp = smgropen((relation)->rd_node, (relation)->rd_backend, (col)); \
|
||||
Assert((relation)->rd_smgr == tmp); \
|
||||
TryFreshSmgrCache((relation)->rd_smgr); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@ -610,7 +608,7 @@ extern void PartitionDecrementReferenceCount(Partition part);
|
||||
#define RelationIsPartitioned(relation) \
|
||||
(PARTTYPE_PARTITIONED_RELATION == (relation)->rd_rel->parttype || \
|
||||
PARTTYPE_SUBPARTITIONED_RELATION == (relation)->rd_rel->parttype)
|
||||
#define RelationIsRangePartitioned(relation) (PARTTYPE_PARTITIONED_RELATION == (relation)->rd_rel->parttype)
|
||||
#define RelationIsCommonPartitioned(relation) (PARTTYPE_PARTITIONED_RELATION == (relation)->rd_rel->parttype)
|
||||
|
||||
#define RelationIsSubPartitioned(relation) (PARTTYPE_SUBPARTITIONED_RELATION == (relation)->rd_rel->parttype)
|
||||
|
||||
@ -792,7 +790,6 @@ static inline bool RelationEnableWaitCleanGpi(Relation relation)
|
||||
}
|
||||
|
||||
/* routines in utils/cache/relcache.c */
|
||||
extern bool RelationIsDfsStore(Relation relatioin);
|
||||
extern bool RelationIsPaxFormatByOid(Oid relid);
|
||||
#ifdef ENABLE_MOT
|
||||
extern bool RelationIsMOTTableByOid(Oid relid);
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
#ifndef RELFILENODEMAP_H
|
||||
#define RELFILENODEMAP_H
|
||||
|
||||
extern Oid RelidByRelfilenodeCache(Oid reltablespace, Oid relfilenode);
|
||||
extern Oid RelidByRelfilenode(Oid reltablespace, Oid relfilenode, bool segment);
|
||||
extern Oid PartitionRelidByRelfilenodeCache(Oid reltablespace, Oid relfilenode, Oid &partationReltoastrelid);
|
||||
extern Oid PartitionRelidByRelfilenode(Oid reltablespace, Oid relfilenode, Oid &partationReltoastrelid,
|
||||
Oid *partitionOid, bool segment);
|
||||
extern Oid UHeapRelidByRelfilenode(Oid reltablespace, Oid relfilenode);
|
||||
extern Oid UHeapPartitionRelidByRelfilenode(Oid reltablespace, Oid relfilenode, Oid& partationReltoastrelid);
|
||||
extern void RelfilenodeMapInvalidateCallback(Datum arg, Oid relid);
|
||||
extern void UHeapRelfilenodeMapInvalidateCallback(Datum arg, Oid relid);
|
||||
extern void PartfilenodeMapInvalidateCallback(Datum arg, Oid relid);
|
||||
extern Oid HeapGetRelid(Oid reltablespace, Oid relfilenode, Oid &partationReltoastrelid, Oid *partitionOid, bool segment);
|
||||
#endif /* RELFILENODEMAP_H */
|
||||
|
||||
@ -68,7 +68,6 @@ extern void ResourceOwnerConcat(ResourceOwner target, ResourceOwner source);
|
||||
extern ResourceOwner ResourceOwnerGetParent(ResourceOwner owner);
|
||||
extern ResourceOwner ResourceOwnerGetNextChild(ResourceOwner owner);
|
||||
extern const char * ResourceOwnerGetName(ResourceOwner owner);
|
||||
extern ResourceOwner ResourceOwnerGetFirstChild(ResourceOwner owner);
|
||||
extern MemoryContext ResourceOwnerGetMemCxt(ResourceOwner owner);
|
||||
extern void ResourceOwnerNewParent(ResourceOwner owner, ResourceOwner newparent);
|
||||
|
||||
@ -120,7 +119,7 @@ extern void ResourceOwnerForgetPlanCacheRef(ResourceOwner owner, CachedPlan* pla
|
||||
/* support for tupledesc refcount management */
|
||||
extern void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner);
|
||||
extern void ResourceOwnerRememberTupleDesc(ResourceOwner owner, TupleDesc tupdesc);
|
||||
extern void ResourceOwnerForgetTupleDesc(ResourceOwner owner, TupleDesc tupdesc);
|
||||
extern bool ResourceOwnerForgetTupleDesc(ResourceOwner owner, TupleDesc tupdesc);
|
||||
|
||||
/* support for snapshot refcount management */
|
||||
extern void ResourceOwnerEnlargeSnapshots(ResourceOwner owner);
|
||||
@ -209,4 +208,5 @@ extern void ResourceOwnerReleaseGlobalBaseEntry(ResourceOwner owner, bool isComm
|
||||
extern void ResourceOwnerReleaseGlobalDBEntry(ResourceOwner owner, bool isCommit);
|
||||
extern void ResourceOwnerReleaseGlobalIsExclusive(ResourceOwner owner, bool isCommit);
|
||||
extern bool CurrentResourceOwnerIsEmpty(ResourceOwner owner);
|
||||
extern void ReleaseResownerOutOfTransaction();
|
||||
#endif /* RESOWNER_H */
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include "access/htup.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "optimizer/nodegroups.h"
|
||||
#include "parser/parse_oper.h"
|
||||
|
||||
/*
|
||||
* Note: the default selectivity estimates are not chosen entirely at random.
|
||||
@ -167,6 +168,19 @@ extern double get_global_rows(double local_rows, double multiple, unsigned int n
|
||||
IsLocatorReplicated((idx)->rel->locator_type), \
|
||||
ng_get_dest_num_data_nodes((root), (idx)->rel))
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
/* get probe for binary search*/
|
||||
#define MID(low, high) (low + high) / 2
|
||||
|
||||
/* get previous bound index */
|
||||
#define PREVIOUS_BOUND(i) i - 2
|
||||
|
||||
/* get previous bound index */
|
||||
#define NEXT_BOUND(i) i + 1
|
||||
|
||||
/* The number of distincts allocated to each bucket must be >= 1.0 */
|
||||
#define CHECK_DISTINCT_HIST(distinct) distinct < 1.0 ? 1.0 : distinct
|
||||
#endif
|
||||
/* Functions in selfuncs.c */
|
||||
|
||||
extern void examine_variable(PlannerInfo* root, Node* node, int varRelid, VariableStatData* vardata);
|
||||
|
||||
@ -161,7 +161,8 @@ enum SysCacheIdentifier {
|
||||
UIDRELID,
|
||||
DBPRIVOID,
|
||||
DBPRIVROLE,
|
||||
DBPRIVROLEPRIV
|
||||
DBPRIVROLEPRIV,
|
||||
SETTYPOIDNAME
|
||||
};
|
||||
struct cachedesc {
|
||||
Oid reloid; /* OID of the relation being cached */
|
||||
|
||||
Reference in New Issue
Block a user