|
25 | 25 | #include "optimizer/clauses.h"
|
26 | 26 | #include "parser/parsetree.h"
|
27 | 27 | #include "rewrite/rewriteHandler.h"
|
| 28 | +#include "storage/bufmgr.h" |
28 | 29 | #include "tcop/tcopprot.h"
|
29 | 30 | #include "utils/builtins.h"
|
30 | 31 | #include "utils/json.h"
|
@@ -684,16 +685,20 @@ report_triggers(ResultRelInfo *rInfo, bool show_relname, ExplainState *es)
|
684 | 685 | appendStringInfo(es->str, " for constraint %s", conname);
|
685 | 686 | if (show_relname)
|
686 | 687 | appendStringInfo(es->str, " on %s", relname);
|
687 |
| - appendStringInfo(es->str, ": time=%.3f calls=%.0f\n", |
688 |
| - 1000.0 * instr->total, instr->ntuples); |
| 688 | + if (es->timing) |
| 689 | + appendStringInfo(es->str, ": time=%.3f calls=%.0f\n", |
| 690 | + 1000.0 * instr->total, instr->ntuples); |
| 691 | + else |
| 692 | + appendStringInfo(es->str, ": calls=%.0f\n", instr->ntuples); |
689 | 693 | }
|
690 | 694 | else
|
691 | 695 | {
|
692 | 696 | ExplainPropertyText("Trigger Name", trig->tgname, es);
|
693 | 697 | if (conname)
|
694 | 698 | ExplainPropertyText("Constraint Name", conname, es);
|
695 | 699 | ExplainPropertyText("Relation", relname, es);
|
696 |
| - ExplainPropertyFloat("Time", 1000.0 * instr->total, 3, es); |
| 700 | + if (es->timing) |
| 701 | + ExplainPropertyFloat("Time", 1000.0 * instr->total, 3, es); |
697 | 702 | ExplainPropertyFloat("Calls", instr->ntuples, 0, es);
|
698 | 703 | }
|
699 | 704 |
|
@@ -1600,8 +1605,11 @@ ExplainNode(PlanState *planstate, List *ancestors,
|
1600 | 1605 | ExplainPropertyLong("Local Written Blocks", usage->local_blks_written, es);
|
1601 | 1606 | ExplainPropertyLong("Temp Read Blocks", usage->temp_blks_read, es);
|
1602 | 1607 | ExplainPropertyLong("Temp Written Blocks", usage->temp_blks_written, es);
|
1603 |
| - ExplainPropertyFloat("I/O Read Time", INSTR_TIME_GET_MILLISEC(usage->blk_read_time), 3, es); |
1604 |
| - ExplainPropertyFloat("I/O Write Time", INSTR_TIME_GET_MILLISEC(usage->blk_write_time), 3, es); |
| 1608 | + if (track_io_timing) |
| 1609 | + { |
| 1610 | + ExplainPropertyFloat("I/O Read Time", INSTR_TIME_GET_MILLISEC(usage->blk_read_time), 3, es); |
| 1611 | + ExplainPropertyFloat("I/O Write Time", INSTR_TIME_GET_MILLISEC(usage->blk_write_time), 3, es); |
| 1612 | + } |
1605 | 1613 | }
|
1606 | 1614 | }
|
1607 | 1615 |
|
|
0 commit comments