@@ -109,8 +109,8 @@ static void show_sort_info(SortState *sortstate, ExplainState *es);
109
109
static void show_incremental_sort_info (IncrementalSortState * incrsortstate ,
110
110
ExplainState * es );
111
111
static void show_hash_info (HashState * hashstate , ExplainState * es );
112
- static void show_resultcache_info ( ResultCacheState * rcstate , List * ancestors ,
113
- ExplainState * es );
112
+ static void show_memoize_info ( MemoizeState * mstate , List * ancestors ,
113
+ ExplainState * es );
114
114
static void show_hashagg_info (AggState * hashstate , ExplainState * es );
115
115
static void show_tidbitmap_info (BitmapHeapScanState * planstate ,
116
116
ExplainState * es );
@@ -1298,8 +1298,8 @@ ExplainNode(PlanState *planstate, List *ancestors,
1298
1298
case T_Material :
1299
1299
pname = sname = "Materialize" ;
1300
1300
break ;
1301
- case T_ResultCache :
1302
- pname = sname = "Result Cache " ;
1301
+ case T_Memoize :
1302
+ pname = sname = "Memoize " ;
1303
1303
break ;
1304
1304
case T_Sort :
1305
1305
pname = sname = "Sort" ;
@@ -2013,9 +2013,9 @@ ExplainNode(PlanState *planstate, List *ancestors,
2013
2013
case T_Hash :
2014
2014
show_hash_info (castNode (HashState , planstate ), es );
2015
2015
break ;
2016
- case T_ResultCache :
2017
- show_resultcache_info (castNode (ResultCacheState , planstate ),
2018
- ancestors , es );
2016
+ case T_Memoize :
2017
+ show_memoize_info (castNode (MemoizeState , planstate ), ancestors ,
2018
+ es );
2019
2019
break ;
2020
2020
default :
2021
2021
break ;
@@ -3085,13 +3085,12 @@ show_hash_info(HashState *hashstate, ExplainState *es)
3085
3085
}
3086
3086
3087
3087
/*
3088
- * Show information on result cache hits/misses/evictions and memory usage.
3088
+ * Show information on memoize hits/misses/evictions and memory usage.
3089
3089
*/
3090
3090
static void
3091
- show_resultcache_info (ResultCacheState * rcstate , List * ancestors ,
3092
- ExplainState * es )
3091
+ show_memoize_info (MemoizeState * mstate , List * ancestors , ExplainState * es )
3093
3092
{
3094
- Plan * plan = ((PlanState * ) rcstate )-> plan ;
3093
+ Plan * plan = ((PlanState * ) mstate )-> plan ;
3095
3094
ListCell * lc ;
3096
3095
List * context ;
3097
3096
StringInfoData keystr ;
@@ -3102,7 +3101,7 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
3102
3101
initStringInfo (& keystr );
3103
3102
3104
3103
/*
3105
- * It's hard to imagine having a result cache with fewer than 2 RTEs, but
3104
+ * It's hard to imagine having a memoize node with fewer than 2 RTEs, but
3106
3105
* let's just keep the same useprefix logic as elsewhere in this file.
3107
3106
*/
3108
3107
useprefix = list_length (es -> rtable ) > 1 || es -> verbose ;
@@ -3112,7 +3111,7 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
3112
3111
plan ,
3113
3112
ancestors );
3114
3113
3115
- foreach (lc , ((ResultCache * ) plan )-> param_exprs )
3114
+ foreach (lc , ((Memoize * ) plan )-> param_exprs )
3116
3115
{
3117
3116
Node * expr = (Node * ) lfirst (lc );
3118
3117
@@ -3138,47 +3137,47 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
3138
3137
if (!es -> analyze )
3139
3138
return ;
3140
3139
3141
- if (rcstate -> stats .cache_misses > 0 )
3140
+ if (mstate -> stats .cache_misses > 0 )
3142
3141
{
3143
3142
/*
3144
3143
* mem_peak is only set when we freed memory, so we must use mem_used
3145
3144
* when mem_peak is 0.
3146
3145
*/
3147
- if (rcstate -> stats .mem_peak > 0 )
3148
- memPeakKb = (rcstate -> stats .mem_peak + 1023 ) / 1024 ;
3146
+ if (mstate -> stats .mem_peak > 0 )
3147
+ memPeakKb = (mstate -> stats .mem_peak + 1023 ) / 1024 ;
3149
3148
else
3150
- memPeakKb = (rcstate -> mem_used + 1023 ) / 1024 ;
3149
+ memPeakKb = (mstate -> mem_used + 1023 ) / 1024 ;
3151
3150
3152
3151
if (es -> format != EXPLAIN_FORMAT_TEXT )
3153
3152
{
3154
- ExplainPropertyInteger ("Cache Hits" , NULL , rcstate -> stats .cache_hits , es );
3155
- ExplainPropertyInteger ("Cache Misses" , NULL , rcstate -> stats .cache_misses , es );
3156
- ExplainPropertyInteger ("Cache Evictions" , NULL , rcstate -> stats .cache_evictions , es );
3157
- ExplainPropertyInteger ("Cache Overflows" , NULL , rcstate -> stats .cache_overflows , es );
3153
+ ExplainPropertyInteger ("Cache Hits" , NULL , mstate -> stats .cache_hits , es );
3154
+ ExplainPropertyInteger ("Cache Misses" , NULL , mstate -> stats .cache_misses , es );
3155
+ ExplainPropertyInteger ("Cache Evictions" , NULL , mstate -> stats .cache_evictions , es );
3156
+ ExplainPropertyInteger ("Cache Overflows" , NULL , mstate -> stats .cache_overflows , es );
3158
3157
ExplainPropertyInteger ("Peak Memory Usage" , "kB" , memPeakKb , es );
3159
3158
}
3160
3159
else
3161
3160
{
3162
3161
ExplainIndentText (es );
3163
3162
appendStringInfo (es -> str ,
3164
3163
"Hits: " UINT64_FORMAT " Misses: " UINT64_FORMAT " Evictions: " UINT64_FORMAT " Overflows: " UINT64_FORMAT " Memory Usage: " INT64_FORMAT "kB\n" ,
3165
- rcstate -> stats .cache_hits ,
3166
- rcstate -> stats .cache_misses ,
3167
- rcstate -> stats .cache_evictions ,
3168
- rcstate -> stats .cache_overflows ,
3164
+ mstate -> stats .cache_hits ,
3165
+ mstate -> stats .cache_misses ,
3166
+ mstate -> stats .cache_evictions ,
3167
+ mstate -> stats .cache_overflows ,
3169
3168
memPeakKb );
3170
3169
}
3171
3170
}
3172
3171
3173
- if (rcstate -> shared_info == NULL )
3172
+ if (mstate -> shared_info == NULL )
3174
3173
return ;
3175
3174
3176
3175
/* Show details from parallel workers */
3177
- for (int n = 0 ; n < rcstate -> shared_info -> num_workers ; n ++ )
3176
+ for (int n = 0 ; n < mstate -> shared_info -> num_workers ; n ++ )
3178
3177
{
3179
- ResultCacheInstrumentation * si ;
3178
+ MemoizeInstrumentation * si ;
3180
3179
3181
- si = & rcstate -> shared_info -> sinstrument [n ];
3180
+ si = & mstate -> shared_info -> sinstrument [n ];
3182
3181
3183
3182
/*
3184
3183
* Skip workers that didn't do any work. We needn't bother checking
@@ -3191,10 +3190,10 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
3191
3190
ExplainOpenWorker (n , es );
3192
3191
3193
3192
/*
3194
- * Since the worker's ResultCacheState .mem_used field is unavailable
3195
- * to us, ExecEndResultCache will have set the
3196
- * ResultCacheInstrumentation .mem_peak field for us. No need to do
3197
- * the zero checks like we did for the serial case above.
3193
+ * Since the worker's MemoizeState .mem_used field is unavailable to
3194
+ * us, ExecEndMemoize will have set the
3195
+ * MemoizeInstrumentation .mem_peak field for us. No need to do the
3196
+ * zero checks like we did for the serial case above.
3198
3197
*/
3199
3198
memPeakKb = (si -> mem_peak + 1023 ) / 1024 ;
3200
3199
0 commit comments