|
23 | 23 | #include "optimizer/clauses.h"
|
24 | 24 | #include "parser/parsetree.h"
|
25 | 25 | #include "rewrite/rewriteHandler.h"
|
| 26 | +#include "storage/bufmgr.h" |
26 | 27 | #include "tcop/tcopprot.h"
|
27 | 28 | #include "utils/builtins.h"
|
28 | 29 | #include "utils/json.h"
|
@@ -630,16 +631,20 @@ report_triggers(ResultRelInfo *rInfo, bool show_relname, ExplainState *es)
|
630 | 631 | appendStringInfo(es->str, " for constraint %s", conname);
|
631 | 632 | if (show_relname)
|
632 | 633 | appendStringInfo(es->str, " on %s", relname);
|
633 |
| - appendStringInfo(es->str, ": time=%.3f calls=%.0f\n", |
634 |
| - 1000.0 * instr->total, instr->ntuples); |
| 634 | + if (es->timing) |
| 635 | + appendStringInfo(es->str, ": time=%.3f calls=%.0f\n", |
| 636 | + 1000.0 * instr->total, instr->ntuples); |
| 637 | + else |
| 638 | + appendStringInfo(es->str, ": calls=%.0f\n", instr->ntuples); |
635 | 639 | }
|
636 | 640 | else
|
637 | 641 | {
|
638 | 642 | ExplainPropertyText("Trigger Name", trig->tgname, es);
|
639 | 643 | if (conname)
|
640 | 644 | ExplainPropertyText("Constraint Name", conname, es);
|
641 | 645 | ExplainPropertyText("Relation", relname, es);
|
642 |
| - ExplainPropertyFloat("Time", 1000.0 * instr->total, 3, es); |
| 646 | + if (es->timing) |
| 647 | + ExplainPropertyFloat("Time", 1000.0 * instr->total, 3, es); |
643 | 648 | ExplainPropertyFloat("Calls", instr->ntuples, 0, es);
|
644 | 649 | }
|
645 | 650 |
|
@@ -1475,8 +1480,11 @@ ExplainNode(PlanState *planstate, List *ancestors,
|
1475 | 1480 | ExplainPropertyLong("Local Written Blocks", usage->local_blks_written, es);
|
1476 | 1481 | ExplainPropertyLong("Temp Read Blocks", usage->temp_blks_read, es);
|
1477 | 1482 | ExplainPropertyLong("Temp Written Blocks", usage->temp_blks_written, es);
|
1478 |
| - ExplainPropertyFloat("I/O Read Time", INSTR_TIME_GET_MILLISEC(usage->blk_read_time), 3, es); |
1479 |
| - ExplainPropertyFloat("I/O Write Time", INSTR_TIME_GET_MILLISEC(usage->blk_write_time), 3, es); |
| 1483 | + if (track_io_timing) |
| 1484 | + { |
| 1485 | + ExplainPropertyFloat("I/O Read Time", INSTR_TIME_GET_MILLISEC(usage->blk_read_time), 3, es); |
| 1486 | + ExplainPropertyFloat("I/O Write Time", INSTR_TIME_GET_MILLISEC(usage->blk_write_time), 3, es); |
| 1487 | + } |
1480 | 1488 | }
|
1481 | 1489 | }
|
1482 | 1490 |
|
|
0 commit comments