Skip to content

Commit

Permalink
disable plan caching when operator rewrite hooks are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Oct 31, 2024
1 parent 4058c1a commit 18f83e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lantern_hnsw/src/hooks/post_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ void post_parse_analyze_hook_with_operator_check(ParseState *pstate,
return;
}

const char *current_mode = GetConfigOption("plan_cache_mode", false, false);

if(strcmp(current_mode, "force_custom_plan") != 0) {
SetConfigOption("plan_cache_mode", "force_custom_plan", PGC_SUSET, PGC_S_SESSION);
}

if(!oidList) {
elog(WARNING, "this hook is experimental and can cause undefined behaviour");
MemoryContext oldCtx = MemoryContextSwitchTo(CacheMemoryContext);
Expand Down

0 comments on commit 18f83e1

Please sign in to comment.