|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "pgpa_trove.h"#include "common/hashfn_unstable.h"#include "lib/simplehash.h"
Go to the source code of this file.
Data Structures | |
| struct | pgpa_trove_slice |
| struct | pgpa_trove |
| struct | pgpa_trove_entry_key |
| struct | pgpa_trove_entry_element |
Typedefs | |
| typedef struct pgpa_trove_slice | pgpa_trove_slice |
| #define SH_DECLARE |
Definition at line 111 of file pgpa_trove.c.
| #define SH_DEFINE |
Definition at line 112 of file pgpa_trove.c.
| #define SH_ELEMENT_TYPE pgpa_trove_entry_element |
Definition at line 105 of file pgpa_trove.c.
Definition at line 109 of file pgpa_trove.c.
| #define SH_HASH_KEY | ( | tb, | |
| key | |||
| ) | pgpa_trove_entry_hash_key(key) |
Definition at line 108 of file pgpa_trove.c.
| #define SH_KEY key |
Definition at line 107 of file pgpa_trove.c.
| #define SH_KEY_TYPE pgpa_trove_entry_key |
Definition at line 106 of file pgpa_trove.c.
| #define SH_PREFIX pgpa_trove_entry |
Definition at line 104 of file pgpa_trove.c.
Definition at line 110 of file pgpa_trove.c.
| pgpa_trove * pgpa_build_trove | ( | List * | advice_items | ) |
Definition at line 132 of file pgpa_trove.c.
References Assert, pgpa_advice_target::children, fb(), foreach_ptr, pgpa_trove::join, palloc0_object, palloc_object, pgpa_init_trove_slice(), PGPA_TAG_BITMAP_HEAP_SCAN, PGPA_TAG_FOREIGN_JOIN, PGPA_TAG_GATHER, PGPA_TAG_GATHER_MERGE, PGPA_TAG_HASH_JOIN, PGPA_TAG_INDEX_ONLY_SCAN, PGPA_TAG_INDEX_SCAN, PGPA_TAG_JOIN_ORDER, PGPA_TAG_MERGE_JOIN_MATERIALIZE, PGPA_TAG_MERGE_JOIN_PLAIN, PGPA_TAG_NESTED_LOOP_MATERIALIZE, PGPA_TAG_NESTED_LOOP_MEMOIZE, PGPA_TAG_NESTED_LOOP_PLAIN, PGPA_TAG_NO_GATHER, PGPA_TAG_PARTITIONWISE, PGPA_TAG_SEMIJOIN_NON_UNIQUE, PGPA_TAG_SEMIJOIN_UNIQUE, PGPA_TAG_SEQ_SCAN, PGPA_TAG_TID_SCAN, PGPA_TARGET_IDENTIFIER, PGPA_TARGET_ORDERED_LIST, pgpa_trove_add_to_slice(), pgpa_trove::rel, pgpa_trove::scan, and pgpa_advice_target::ttype.
Referenced by pgpa_planner_setup().
| char * pgpa_cstring_trove_entry | ( | pgpa_trove_entry * | entry | ) |
Definition at line 295 of file pgpa_trove.c.
References appendStringInfo(), appendStringInfoChar(), Assert, buf, fb(), initStringInfo(), pgpa_advice_target::itarget, pgpa_cstring_advice_tag(), pgpa_format_advice_target(), pgpa_format_index_target(), PGPA_TAG_JOIN_ORDER, PGPA_TARGET_ORDERED_LIST, pgpa_trove_entry::tag, pgpa_trove_entry::target, and pgpa_advice_target::ttype.
Referenced by pgpa_planner_append_feedback().
|
static |
Definition at line 431 of file pgpa_trove.c.
References CurrentMemoryContext, fb(), and palloc_array.
Referenced by pgpa_build_trove().
|
static |
Definition at line 396 of file pgpa_trove.c.
References pgpa_identifier::alias_name, Assert, bms_add_member(), pgpa_advice_target::children, element(), fb(), foreach_ptr, hash(), pgpa_identifier::occurrence, pgpa_identifier::partrel, PGPA_TARGET_IDENTIFIER, pgpa_trove_add_to_hash(), pgpa_identifier::plan_name, pgpa_advice_target::rid, and pgpa_advice_target::ttype.
Referenced by pgpa_trove_add_to_hash(), and pgpa_trove_add_to_slice().
|
static |
Definition at line 366 of file pgpa_trove.c.
References fb(), pgpa_trove_entry::flags, pgpa_trove_add_to_hash(), repalloc_array, pgpa_trove_entry::tag, and pgpa_trove_entry::target.
Referenced by pgpa_build_trove().
| void pgpa_trove_append_flags | ( | StringInfo | buf, |
| int | flags | ||
| ) |
Definition at line 343 of file pgpa_trove.c.
References appendStringInfo(), Assert, buf, PGPA_TE_CONFLICTING, PGPA_TE_FAILED, PGPA_TE_INAPPLICABLE, PGPA_TE_MATCH_FULL, and PGPA_TE_MATCH_PARTIAL.
Referenced by pg_plan_advice_explain_feedback(), and pgpa_planner_feedback_warning().
|
inlinestatic |
Definition at line 90 of file pgpa_trove.c.
References a, b, fb(), and strings_equal_or_both_null().
|
static |
Definition at line 454 of file pgpa_trove.c.
References fasthash_accum_cstring(), fasthash_final32(), fasthash_init(), and fb().
| void pgpa_trove_lookup | ( | pgpa_trove * | trove, |
| pgpa_trove_lookup_type | type, | ||
| int | nrids, | ||
| pgpa_identifier * | rids, | ||
| pgpa_trove_result * | result | ||
| ) |
Definition at line 233 of file pgpa_trove.c.
References Assert, bms_union(), pgpa_trove_result::entries, fb(), i, pgpa_trove_result::indexes, pgpa_trove::join, PGPA_TROVE_LOOKUP_JOIN, PGPA_TROVE_LOOKUP_SCAN, pgpa_trove_slice_lookup(), pgpa_trove::rel, pgpa_trove::scan, strings_equal_or_both_null(), and type.
Referenced by pgpa_build_simple_rel(), and pgpa_get_join_state().
| void pgpa_trove_lookup_all | ( | pgpa_trove * | trove, |
| pgpa_trove_lookup_type | type, | ||
| pgpa_trove_entry ** | entries, | ||
| int * | nentries | ||
| ) |
Definition at line 275 of file pgpa_trove.c.
References fb(), pgpa_trove::join, PGPA_TROVE_LOOKUP_JOIN, PGPA_TROVE_LOOKUP_SCAN, pgpa_trove::rel, pgpa_trove::scan, and type.
Referenced by pgpa_planner_append_feedback().
| void pgpa_trove_set_flags | ( | pgpa_trove_entry * | entries, |
| Bitmapset * | indexes, | ||
| int | flags | ||
| ) |
Definition at line 326 of file pgpa_trove.c.
References bms_next_member(), pgpa_trove_entry::flags, and i.
Referenced by pgpa_planner_apply_join_path_advice(), pgpa_planner_apply_joinrel_advice(), and pgpa_planner_apply_scan_advice().
|
static |
Definition at line 482 of file pgpa_trove.c.
References pgpa_identifier::alias_name, Assert, bms_add_member(), bms_next_member(), element(), fb(), i, pgpa_identifier::occurrence, pgpa_identifier::partrel, pgpa_identifier_matches_target(), pgpa_identifier::plan_name, and pgpa_trove_entry::target.
Referenced by pgpa_trove_lookup().