|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Data Structures | |
| struct | pgsa_entry_key |
| struct | pgsa_entry |
| struct | pgsa_stash |
| struct | pgsa_shared_state |
| struct | pgsa_stash_name |
Macros | |
| #define | PGSA_DUMP_FILE "pg_stash_advice.tsv" |
| #define | SH_PREFIX pgsa_stash_name_table |
| #define | SH_ELEMENT_TYPE pgsa_stash_name |
| #define | SH_KEY_TYPE uint64 |
| #define | SH_SCOPE extern |
| #define | SH_DECLARE |
Typedefs | |
| typedef struct pgsa_entry_key | pgsa_entry_key |
| typedef struct pgsa_entry | pgsa_entry |
| typedef struct pgsa_stash | pgsa_stash |
| typedef struct pgsa_shared_state | pgsa_shared_state |
| typedef struct pgsa_stash_name | pgsa_stash_name |
Functions | |
| void | pgsa_attach (void) |
| void | pgsa_check_lockout (void) |
| void | pgsa_check_stash_name (char *stash_name) |
| void | pgsa_clear_advice_string (char *stash_name, int64 queryId) |
| void | pgsa_create_stash (char *stash_name) |
| void | pgsa_drop_stash (char *stash_name) |
| uint64 | pgsa_lookup_stash_id (char *stash_name) |
| void | pgsa_reset_all_stashes (void) |
| void | pgsa_set_advice_string (char *stash_name, int64 queryId, char *advice_string) |
| void | pgsa_start_worker (void) |
Variables | |
| pgsa_shared_state * | pgsa_state |
| dsa_area * | pgsa_dsa_area |
| dshash_table * | pgsa_stash_dshash |
| dshash_table * | pgsa_entry_dshash |
| bool | pg_stash_advice_persist |
| int | pg_stash_advice_persist_interval |
| #define PGSA_DUMP_FILE "pg_stash_advice.tsv" |
Definition at line 25 of file pg_stash_advice.h.
| #define SH_DECLARE |
Definition at line 85 of file pg_stash_advice.h.
| #define SH_ELEMENT_TYPE pgsa_stash_name |
Definition at line 82 of file pg_stash_advice.h.
Definition at line 83 of file pg_stash_advice.h.
| #define SH_PREFIX pgsa_stash_name_table |
Definition at line 81 of file pg_stash_advice.h.
Definition at line 84 of file pg_stash_advice.h.
| typedef struct pgsa_entry pgsa_entry |
| typedef struct pgsa_entry_key pgsa_entry_key |
| typedef struct pgsa_stash pgsa_stash |
Definition at line 221 of file pg_stash_advice.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, pgsa_shared_state::area, dsa_attach(), dsa_create, dsa_get_handle(), DSA_HANDLE_INVALID, dsa_pin(), dsa_pin_mapping(), pgsa_shared_state::dsa_tranche, dshash_attach(), dshash_create(), dshash_get_hash_table_handle(), DSHASH_HANDLE_INVALID, pgsa_shared_state::entry_hash, pgsa_shared_state::entry_tranche, fb(), GetNamedDSMSegment(), pgsa_shared_state::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MemoryContextSwitchTo(), pg_stash_advice_mcxt, pgsa_dsa_area, pgsa_entry_dshash, pgsa_entry_dshash_parameters, pgsa_init_shared_state(), pgsa_stash_dshash, pgsa_stash_dshash_parameters, pgsa_state, pgsa_shared_state::stash_hash, pgsa_shared_state::stash_tranche, TopMemoryContext, and dshash_parameters::tranche_id.
Referenced by pg_create_advice_stash(), pg_drop_advice_stash(), pg_get_advice_stash_contents(), pg_get_advice_stashes(), pg_set_stashed_advice(), pg_start_stash_advice_worker(), pg_stash_advice_worker_main(), and pgsa_advisor().
Definition at line 325 of file pg_stash_advice.c.
References ereport, errcode(), errmsg, ERROR, fb(), pg_atomic_unlocked_test_flag(), PGSA_DUMP_FILE, pgsa_state, and pgsa_shared_state::stashes_ready.
Referenced by pg_create_advice_stash(), pg_drop_advice_stash(), and pg_set_stashed_advice().
Definition at line 340 of file pg_stash_advice.c.
References ereport, errcode(), errmsg, ERROR, fb(), NAMEDATALEN, pg_is_ascii(), and pgsa_is_identifier().
Referenced by pg_create_advice_stash(), pg_drop_advice_stash(), pg_get_advice_stash_contents(), and pg_set_stashed_advice().
Definition at line 447 of file pg_stash_advice.c.
References pgsa_entry::advice_string, Assert, pgsa_shared_state::change_count, dsa_free(), dshash_delete_entry(), dshash_find(), ereport, errcode(), errmsg, ERROR, fb(), InvalidDsaPointer, pgsa_shared_state::lock, LWLockHeldByMe(), pg_atomic_add_fetch_u64(), pgsa_dsa_area, pgsa_entry_dshash, pgsa_lookup_stash_id(), and pgsa_state.
Referenced by pg_set_stashed_advice().
Definition at line 423 of file pg_stash_advice.c.
References Assert, pgsa_shared_state::change_count, dshash_find_or_insert, dshash_release_lock(), ereport, errcode(), errmsg, ERROR, fb(), pgsa_shared_state::lock, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pgsa_shared_state::next_stash_id, pg_atomic_add_fetch_u64(), pgsa_stash_dshash, and pgsa_state.
Referenced by pg_create_advice_stash(), and pgsa_restore_stashes().
Definition at line 490 of file pg_stash_advice.c.
References pgsa_entry::advice_string, Assert, pgsa_shared_state::change_count, dsa_free(), dshash_delete_current(), dshash_delete_entry(), dshash_find(), dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), ereport, errcode(), errmsg, ERROR, fb(), InvalidDsaPointer, pgsa_entry::key, pgsa_shared_state::lock, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pg_atomic_add_fetch_u64(), pgsa_dsa_area, pgsa_entry_dshash, pgsa_stash_dshash, pgsa_entry_key::pgsa_stash_id, and pgsa_state.
Referenced by pg_drop_advice_stash().
Definition at line 628 of file pg_stash_advice.c.
References dshash_find(), dshash_release_lock(), fb(), and pgsa_stash_dshash.
Referenced by pg_get_advice_stash_contents(), pgsa_advisor(), pgsa_clear_advice_string(), and pgsa_set_advice_string().
Definition at line 537 of file pg_stash_advice.c.
References pgsa_entry::advice_string, Assert, dsa_free(), dshash_delete_current(), dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), fb(), InvalidDsaPointer, pgsa_shared_state::lock, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pgsa_shared_state::next_stash_id, pgsa_dsa_area, pgsa_entry_dshash, pgsa_stash_dshash, pgsa_state, and UINT64CONST.
Referenced by pgsa_read_from_disk().
Definition at line 647 of file pg_stash_advice.c.
References pgsa_entry::advice_string, Assert, pgsa_shared_state::change_count, dsa_allocate, dsa_free(), dsa_get_address(), DsaPointerIsValid, dshash_find_or_insert_extended(), DSHASH_INSERT_NO_OOM, dshash_release_lock(), ereport, errcode(), errdetail(), errmsg, ERROR, fb(), InvalidDsaPointer, pgsa_shared_state::lock, LWLockHeldByMe(), pg_atomic_add_fetch_u64(), pgsa_dsa_area, pgsa_entry_dshash, pgsa_lookup_stash_id(), and pgsa_state.
Referenced by pg_set_stashed_advice(), and pgsa_restore_entries().
Definition at line 726 of file pg_stash_advice.c.
References BGW_DEFAULT_RESTART_INTERVAL, BackgroundWorker::bgw_flags, BackgroundWorker::bgw_function_name, BackgroundWorker::bgw_library_name, BackgroundWorker::bgw_name, BackgroundWorker::bgw_notify_pid, BackgroundWorker::bgw_restart_time, BackgroundWorker::bgw_start_time, BackgroundWorker::bgw_type, BGWH_STARTED, BGWORKER_SHMEM_ACCESS, BgWorkerStart_ConsistentState, ereport, errcode(), errhint(), errmsg, ERROR, fb(), MyProcPid, process_shared_preload_libraries_in_progress, RegisterBackgroundWorker(), RegisterDynamicBackgroundWorker(), and WaitForBackgroundWorkerStartup().
Referenced by _PG_init(), and pg_start_stash_advice_worker().
|
extern |
Definition at line 48 of file pg_stash_advice.c.
Referenced by _PG_init(), and pgsa_init_shared_state().
|
extern |
Definition at line 49 of file pg_stash_advice.c.
Referenced by _PG_init(), and pg_stash_advice_worker_main().
|
extern |
Definition at line 53 of file pg_stash_advice.c.
Referenced by pg_get_advice_stash_contents(), pgsa_advisor(), pgsa_attach(), pgsa_clear_advice_string(), pgsa_drop_stash(), pgsa_reset_all_stashes(), pgsa_set_advice_string(), and pgsa_write_entries().
|
extern |
Definition at line 55 of file pg_stash_advice.c.
Referenced by pg_create_advice_stash(), pg_drop_advice_stash(), pg_get_advice_stash_contents(), pg_get_advice_stashes(), pg_set_stashed_advice(), pg_start_stash_advice_worker(), pgsa_advisor(), pgsa_attach(), pgsa_clear_advice_string(), pgsa_drop_stash(), pgsa_read_from_disk(), pgsa_reset_all_stashes(), pgsa_set_advice_string(), pgsa_write_entries(), and pgsa_write_to_disk().
|
extern |
Definition at line 54 of file pg_stash_advice.c.
Referenced by pg_get_advice_stash_contents(), pg_get_advice_stashes(), pgsa_attach(), pgsa_create_stash(), pgsa_drop_stash(), pgsa_lookup_stash_id(), pgsa_reset_all_stashes(), and pgsa_write_stashes().
|
extern |
Definition at line 52 of file pg_stash_advice.c.
Referenced by pg_create_advice_stash(), pg_drop_advice_stash(), pg_get_advice_stash_contents(), pg_get_advice_stashes(), pg_set_stashed_advice(), pg_start_stash_advice_worker(), pg_stash_advice_worker_main(), pgsa_advisor(), pgsa_attach(), pgsa_check_lockout(), pgsa_clear_advice_string(), pgsa_create_stash(), pgsa_detach_shmem(), pgsa_drop_stash(), pgsa_read_from_disk(), pgsa_reset_all_stashes(), pgsa_restore_entries(), pgsa_restore_stashes(), and pgsa_set_advice_string().