Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fd12c12

Browse files
committed
Remove SRF implementation of pg_gtt_statistic_for_relation
1 parent 59b40f4 commit fd12c12

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/backend/commands/analyze.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,6 @@ Datum
28862886
pg_gtt_statistic_for_relation(PG_FUNCTION_ARGS)
28872887
{
28882888
Oid starelid = PG_GETARG_OID(0);
2889-
#if 1
28902889
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
28912890
Tuplestorestate *tupstore;
28922891
MemoryContext per_query_ctx;
@@ -2942,45 +2941,4 @@ pg_gtt_statistic_for_relation(PG_FUNCTION_ARGS)
29422941
tuplestore_donestoring(tupstore);
29432942

29442943
return (Datum) 0;
2945-
#else
2946-
FuncCallContext *funcctx;
2947-
PgTempStatIteratorCtx *it;
2948-
HeapTuple statup;
2949-
2950-
if (SRF_IS_FIRSTCALL())
2951-
{
2952-
MemoryContext oldcontext;
2953-
2954-
/* create a function context for cross-call persistence */
2955-
funcctx = SRF_FIRSTCALL_INIT();
2956-
2957-
/* switch to memory context appropriate for multiple function calls */
2958-
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
2959-
it = palloc0(sizeof(PgTempStatIteratorCtx));
2960-
funcctx->user_fctx = (void *)it;
2961-
2962-
MemoryContextSwitchTo(oldcontext);
2963-
}
2964-
else
2965-
{
2966-
funcctx = SRF_PERCALL_SETUP();
2967-
it = (PgTempStatIteratorCtx*)funcctx->user_fctx;
2968-
}
2969-
while (true)
2970-
{
2971-
it->staattnum += 1;
2972-
statup = SearchSysCacheCopy3(STATRELATTINH,
2973-
ObjectIdGetDatum(starelid),
2974-
Int16GetDatum(it->staattnum),
2975-
BoolGetDatum(it->stainherit));
2976-
if (statup != NULL)
2977-
SRF_RETURN_NEXT(funcctx, statup);
2978-
2979-
if (it->stainherit)
2980-
SRF_RETURN_DONE(funcctx);
2981-
2982-
it->stainherit = true;
2983-
it->staattnum = 0;
2984-
}
2985-
#endif
29862944
}

0 commit comments

Comments
 (0)