@@ -109,8 +109,8 @@ static void show_sort_info(SortState *sortstate, ExplainState *es);
109109static void show_incremental_sort_info (IncrementalSortState * incrsortstate ,
110110 ExplainState * es );
111111static 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 );
114114static void show_hashagg_info (AggState * hashstate , ExplainState * es );
115115static void show_tidbitmap_info (BitmapHeapScanState * planstate ,
116116 ExplainState * es );
@@ -1298,8 +1298,8 @@ ExplainNode(PlanState *planstate, List *ancestors,
12981298 case T_Material :
12991299 pname = sname = "Materialize" ;
13001300 break ;
1301- case T_ResultCache :
1302- pname = sname = "Result Cache " ;
1301+ case T_Memoize :
1302+ pname = sname = "Memoize " ;
13031303 break ;
13041304 case T_Sort :
13051305 pname = sname = "Sort" ;
@@ -2013,9 +2013,9 @@ ExplainNode(PlanState *planstate, List *ancestors,
20132013 case T_Hash :
20142014 show_hash_info (castNode (HashState , planstate ), es );
20152015 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 );
20192019 break ;
20202020 default :
20212021 break ;
@@ -3085,13 +3085,12 @@ show_hash_info(HashState *hashstate, ExplainState *es)
30853085}
30863086
30873087/*
3088- * Show information on result cache hits/misses/evictions and memory usage.
3088+ * Show information on memoize hits/misses/evictions and memory usage.
30893089 */
30903090static void
3091- show_resultcache_info (ResultCacheState * rcstate , List * ancestors ,
3092- ExplainState * es )
3091+ show_memoize_info (MemoizeState * mstate , List * ancestors , ExplainState * es )
30933092{
3094- Plan * plan = ((PlanState * ) rcstate )-> plan ;
3093+ Plan * plan = ((PlanState * ) mstate )-> plan ;
30953094 ListCell * lc ;
30963095 List * context ;
30973096 StringInfoData keystr ;
@@ -3102,7 +3101,7 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
31023101 initStringInfo (& keystr );
31033102
31043103 /*
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
31063105 * let's just keep the same useprefix logic as elsewhere in this file.
31073106 */
31083107 useprefix = list_length (es -> rtable ) > 1 || es -> verbose ;
@@ -3112,7 +3111,7 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
31123111 plan ,
31133112 ancestors );
31143113
3115- foreach (lc , ((ResultCache * ) plan )-> param_exprs )
3114+ foreach (lc , ((Memoize * ) plan )-> param_exprs )
31163115 {
31173116 Node * expr = (Node * ) lfirst (lc );
31183117
@@ -3138,47 +3137,47 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
31383137 if (!es -> analyze )
31393138 return ;
31403139
3141- if (rcstate -> stats .cache_misses > 0 )
3140+ if (mstate -> stats .cache_misses > 0 )
31423141 {
31433142 /*
31443143 * mem_peak is only set when we freed memory, so we must use mem_used
31453144 * when mem_peak is 0.
31463145 */
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 ;
31493148 else
3150- memPeakKb = (rcstate -> mem_used + 1023 ) / 1024 ;
3149+ memPeakKb = (mstate -> mem_used + 1023 ) / 1024 ;
31513150
31523151 if (es -> format != EXPLAIN_FORMAT_TEXT )
31533152 {
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 );
31583157 ExplainPropertyInteger ("Peak Memory Usage" , "kB" , memPeakKb , es );
31593158 }
31603159 else
31613160 {
31623161 ExplainIndentText (es );
31633162 appendStringInfo (es -> str ,
31643163 "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 ,
31693168 memPeakKb );
31703169 }
31713170 }
31723171
3173- if (rcstate -> shared_info == NULL )
3172+ if (mstate -> shared_info == NULL )
31743173 return ;
31753174
31763175 /* 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 ++ )
31783177 {
3179- ResultCacheInstrumentation * si ;
3178+ MemoizeInstrumentation * si ;
31803179
3181- si = & rcstate -> shared_info -> sinstrument [n ];
3180+ si = & mstate -> shared_info -> sinstrument [n ];
31823181
31833182 /*
31843183 * Skip workers that didn't do any work. We needn't bother checking
@@ -3191,10 +3190,10 @@ show_resultcache_info(ResultCacheState *rcstate, List *ancestors,
31913190 ExplainOpenWorker (n , es );
31923191
31933192 /*
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.
31983197 */
31993198 memPeakKb = (si -> mem_peak + 1023 ) / 1024 ;
32003199
0 commit comments