@@ -284,31 +284,40 @@ enum ControlFlow { Continue, Break }
284284    protected  abstract  double  estimateSelectivity ();
285285
286286    /** 
287-      * Formats the whole plan as a pretty tree 
287+      * Formats the whole plan as a pretty tree, redacting the queried column values.  
288288     */ 
289-     public  final  String  toStringRecursive ()
289+     public  final  String  toRedactedStringRecursive ()
290290    {
291291        return  toStringRecursive (true );
292292    }
293293
294+     /** 
295+      * Formats the whole plan as a pretty tree, redacting the queried column values. 
296+      */ 
297+     public  final  String  toUnredactedStringRecursive ()
298+     {
299+         return  toStringRecursive (false );
300+     }
301+ 
294302    /** 
295303     * Formats the whole plan as a pretty tree 
296304     * 
297305     * @param redact whether to redact the queried column values. 
298306     */ 
299-     public  final  String  toStringRecursive (boolean  redact )
307+     private  final  String  toStringRecursive (boolean  redact )
300308    {
301309        TreeFormatter <Plan > formatter  = new  TreeFormatter <>(plan  -> plan .toString (redact ), Plan ::subplans );
302310        return  formatter .format (this );
303311    }
304312
305313    /** 
306-      * Returns the string representation of this node only 
314+      * Returns the string representation of this node only, without redacting the queried column values. 
315+      * @see #toString(boolean) 
307316     */ 
308317    @ Override 
309318    public  final  String  toString ()
310319    {
311-         return  toString (true );
320+         return  toString (false );
312321    }
313322
314323    /** 
@@ -327,7 +336,7 @@ public final String toString(boolean redact)
327336
328337    /** 
329338     * Returns additional information specific to the node displayed in the first line. 
330-      * The information is included in the output of {@link #toString()} and {@link #toStringRecursive ()}. 
339+      * The information is included in the output of {@link #toString()} and {@link #toRedactedStringRecursive ()}. 
331340     * It is up to subclasses to implement it. 
332341     */ 
333342    protected  String  title (boolean  redact )
@@ -337,7 +346,7 @@ protected String title(boolean redact)
337346
338347    /** 
339348     * Returns additional information specific to the node, displayed below the title. 
340-      * The information is included in the output of {@link #toString()} and {@link #toStringRecursive ()}. 
349+      * The information is included in the output of {@link #toString()} and {@link #toRedactedStringRecursive ()}. 
341350     * It is up to subclasses to implement it. 
342351     */ 
343352    protected  String  description ()
@@ -366,7 +375,7 @@ protected String description()
366375    public  final  Plan  optimize ()
367376    {
368377        if  (logger .isTraceEnabled ())
369-             logger .trace ("Optimizing plan:\n {}" , toStringRecursive ());
378+             logger .trace ("Optimizing plan:\n {}" , toRedactedStringRecursive ());
370379
371380        Plan  bestPlanSoFar  = this ;
372381        List <Leaf > leaves  = nodesOfType (Leaf .class );
@@ -381,14 +390,14 @@ public final Plan optimize()
381390
382391            Plan  candidate  = bestPlanSoFar .removeRestriction (leaf .id );
383392            if  (logger .isTraceEnabled ())
384-                 logger .trace ("Candidate query plan:\n {}" , candidate .toStringRecursive ());
393+                 logger .trace ("Candidate query plan:\n {}" , candidate .toRedactedStringRecursive ());
385394
386395            if  (candidate .fullCost () <= bestPlanSoFar .fullCost ())
387396                bestPlanSoFar  = candidate ;
388397        }
389398
390399        if  (logger .isTraceEnabled ())
391-             logger .trace ("Optimized plan:\n {}" , bestPlanSoFar .toStringRecursive ());
400+             logger .trace ("Optimized plan:\n {}" , bestPlanSoFar .toRedactedStringRecursive ());
392401        return  bestPlanSoFar ;
393402    }
394403
0 commit comments