mirror of
https://github.com/HypoPG/hypopg
synced 2026-05-24 09:38:21 +00:00
Add a hypopg_reset_index() SQL wrapper.
This commit is contained in:
parent
eac1d61f93
commit
74a6fa8fd4
3 changed files with 17 additions and 0 deletions
|
|
@ -8,6 +8,11 @@
|
|||
|
||||
SET client_encoding = 'UTF8';
|
||||
|
||||
CREATE FUNCTION hypopg_reset_index()
|
||||
RETURNS void
|
||||
LANGUAGE C VOLATILE COST 100
|
||||
AS '$libdir/hypopg', 'hypopg_reset_index';
|
||||
|
||||
CREATE FUNCTION hypopg_reset()
|
||||
RETURNS void
|
||||
LANGUAGE C VOLATILE COST 100
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ PG_FUNCTION_INFO_V1(hypopg_create_index);
|
|||
PG_FUNCTION_INFO_V1(hypopg_drop_index);
|
||||
PG_FUNCTION_INFO_V1(hypopg_relation_size);
|
||||
PG_FUNCTION_INFO_V1(hypopg_get_indexdef);
|
||||
PG_FUNCTION_INFO_V1(hypopg_reset_index);
|
||||
|
||||
|
||||
static void hypo_addIndex(hypoIndex *entry);
|
||||
|
|
@ -1338,6 +1339,16 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS)
|
|||
PG_RETURN_TEXT_P(cstring_to_text(buf.data));
|
||||
}
|
||||
|
||||
/*
|
||||
* SQL wrapper to remove all declared hypothetical indexes.
|
||||
*/
|
||||
Datum
|
||||
hypopg_reset_index(PG_FUNCTION_ARGS)
|
||||
{
|
||||
hypo_index_reset();
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
|
||||
/* Simple function to set the indexname, dealing with max name length, and the
|
||||
* ending \0
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ Datum hypopg_create_index(PG_FUNCTION_ARGS);
|
|||
Datum hypopg_drop_index(PG_FUNCTION_ARGS);
|
||||
Datum hypopg_relation_size(PG_FUNCTION_ARGS);
|
||||
Datum hypopg_get_indexdef(PG_FUNCTION_ARGS);
|
||||
Datum hypopg_reset_index(PG_FUNCTION_ARGS);
|
||||
|
||||
extern explain_get_index_name_hook_type prev_explain_get_index_name_hook;
|
||||
const char *hypo_explain_get_index_name_hook(Oid indexId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue