34#define SH_PREFIX pgsa_stash_count_table
35#define SH_ELEMENT_TYPE pgsa_stash_count
36#define SH_KEY_TYPE uint64
37#define SH_KEY pgsa_stash_id
38#define SH_HASH_KEY(tb, key) hash_bytes((const unsigned char *) &(key), sizeof(uint64))
39#define SH_EQUAL(tb, a, b) (a == b)
40#define SH_SCOPE static inline
186 stash->pgsa_stash_id,
283 errmsg(
"cannot set advice string for query ID 0"));
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define Assert(condition)
void * dsa_get_address(dsa_area *area, dsa_pointer dp)
#define InvalidDsaPointer
void dshash_seq_init(dshash_seq_status *status, dshash_table *hash_table, bool exclusive)
void dshash_seq_term(dshash_seq_status *status)
void * dshash_seq_next(dshash_seq_status *status)
int errcode(int sqlerrcode)
#define ereport(elevel,...)
#define PG_GETARG_TEXT_PP(n)
#define PG_GETARG_INT64(n)
#define PG_FUNCTION_INFO_V1(funcname)
void InitMaterializedSRF(FunctionCallInfo fcinfo, uint32 flags)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
char * pstrdup(const char *in)
MemoryContext CurrentMemoryContext
dshash_table * pgsa_entry_dshash
dshash_table * pgsa_stash_dshash
void pgsa_create_stash(char *stash_name)
void pgsa_drop_stash(char *stash_name)
void pgsa_set_advice_string(char *stash_name, int64 queryId, char *advice_string)
uint64 pgsa_lookup_stash_id(char *stash_name)
void pgsa_check_stash_name(char *stash_name)
pgsa_shared_state * pgsa_state
void pgsa_clear_advice_string(char *stash_name, int64 queryId)
static Datum Int64GetDatum(int64 X)
char * psprintf(const char *fmt,...)
Datum pg_get_advice_stash_contents(PG_FUNCTION_ARGS)
Datum pg_get_advice_stashes(PG_FUNCTION_ARGS)
Datum pg_drop_advice_stash(PG_FUNCTION_ARGS)
Datum pg_create_advice_stash(PG_FUNCTION_ARGS)
Datum pg_set_stashed_advice(PG_FUNCTION_ARGS)
dsa_pointer advice_string
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)
char * text_to_cstring(const text *t)